DGtal  0.9.3
Functions
testCheckImageConcept.cpp File Reference
#include "DGtal/helpers/StdDefs.h"
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/images/ImageContainerBySTLVector.h"
#include "DGtal/images/ImageContainerBySTLMap.h"
#include "DGtal/images/ImageContainerByITKImage.h"
#include "DGtal/images/ImageContainerByHashTree.h"
#include "DGtal/images/CImage.h"
Include dependency graph for testCheckImageConcept.cpp:

Go to the source code of this file.

Functions

bool testCheckImageConcept ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2010/11/28

Functions for testing the models of the Image concept.

This file is part of the DGtal library.

Definition in file testCheckImageConcept.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 92 of file testCheckImageConcept.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testCheckImageConcept(), and DGtal::trace.

93 {
94  trace.beginBlock ( "Testing class CheckImageConcept" );
95  trace.info() << "Args:";
96  for ( int i = 0; i < argc; ++i )
97  trace.info() << " " << argv[ i ];
98  trace.info() << endl;
99 
100  bool res = testCheckImageConcept(); // && ... other tests
101  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
102  trace.endBlock();
103  return res ? 0 : 1;
104 }
void beginBlock(const std::string &keyword="")
bool testCheckImageConcept()
Trace trace
Definition: Common.h:137
double endBlock()
std::ostream & emphase()
std::ostream & info()

◆ testCheckImageConcept()

bool testCheckImageConcept ( )

Example of a test. To be completed.

Definition at line 55 of file testCheckImageConcept.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by main().

56 {
57  unsigned int nbok = 0;
58  unsigned int nb = 0;
59 
60  trace.beginBlock ( "Testing block ..." );
61 
62  typedef ImageContainerBySTLVector<Domain, int> ImageVector;
64 
65 #ifdef WITH_ITK
67 #endif
68 
69  //HashTree is not (yet) a model of CImage
71 
72  BOOST_CONCEPT_ASSERT(( concepts::CImage< ImageVector >));
73  BOOST_CONCEPT_ASSERT(( concepts::CImage< ImageMap >));
74 #ifdef WITH_ITK
75  BOOST_CONCEPT_ASSERT(( concepts::CImage< ImageITK >));
76 #endif
77 
78  BOOST_CONCEPT_ASSERT(( concepts::CImage< ImageHash >));
79 
80  nbok += true ? 1 : 0;
81  nb++;
82  trace.info() << "(" << nbok << "/" << nb << ") "
83  << "true == true" << std::endl;
84  trace.endBlock();
85 
86  return nbok == nb;
87 }
void beginBlock(const std::string &keyword="")
Trace trace
Definition: Common.h:137
double endBlock()
Model of CImageContainer implementing the association key<->Value using a hash tree. This class provides a built-in iterator.
std::ostream & info()
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102
Aim: implements a model of CImageContainer using a ITK Image.