DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions
DGtal::PGMReader< TImageContainer, TFunctor > Struct Template Reference

Aim: Import a 2D or 3D using the Netpbm formats (ASCII mode). More...

#include <DGtal/io/readers/PGMReader.h>

Public Types

enum  MagicNumber {
  P1 , P2 , P3 , P4 ,
  P5 , P6
}
 
typedef TImageContainer ImageContainer
 
typedef TImageContainer::Value Value
 
typedef TImageContainer::Domain::Vector Vector
 
typedef TFunctor Functor
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TFunctor, unsigned char, Value >))
 
 BOOST_STATIC_ASSERT ((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
 

Static Public Member Functions

static ImageContainer importPGM (const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
 
static ImageContainer importPGM3D (const std::string &aFilename, const Functor &aFunctor=Functor())
 

Detailed Description

template<typename TImageContainer, typename TFunctor = functors::Cast<typename TImageContainer::Value>>
struct DGtal::PGMReader< TImageContainer, TFunctor >

Aim: Import a 2D or 3D using the Netpbm formats (ASCII mode).

Description of class 'PGMReader'

Template Parameters
TImageContainerthe type of the image container
TFunctorthe type of functor used in the import (by default set to functors::Cast< TImageContainer::Value>) .
Examples
images/exampleRigidtransformation2d.cpp, and topology/ctopo-2.cpp.

Definition at line 97 of file PGMReader.h.

Member Typedef Documentation

◆ Functor

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
typedef TFunctor DGtal::PGMReader< TImageContainer, TFunctor >::Functor

Definition at line 106 of file PGMReader.h.

◆ ImageContainer

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
typedef TImageContainer DGtal::PGMReader< TImageContainer, TFunctor >::ImageContainer

Definition at line 102 of file PGMReader.h.

◆ Value

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
typedef TImageContainer::Value DGtal::PGMReader< TImageContainer, TFunctor >::Value

Definition at line 103 of file PGMReader.h.

◆ Vector

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
typedef TImageContainer::Domain::Vector DGtal::PGMReader< TImageContainer, TFunctor >::Vector

Definition at line 104 of file PGMReader.h.

Member Enumeration Documentation

◆ MagicNumber

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
enum DGtal::PGMReader::MagicNumber
Enumerator
P1 
P2 
P3 
P4 
P5 
P6 

Definition at line 108 of file PGMReader.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
DGtal::PGMReader< TImageContainer, TFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< TFunctor, unsigned char, Value >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
DGtal::PGMReader< TImageContainer, TFunctor >::BOOST_STATIC_ASSERT ( (ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3)  )

◆ importPGM()

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
static ImageContainer DGtal::PGMReader< TImageContainer, TFunctor >::importPGM ( const std::string &  aFilename,
const Functor aFunctor = Functor(),
bool  topbotomOrder = true 
)
static

Main method to import a Pgm (8bits) into an instance of the template parameter ImageContainer.

Parameters
aFilenamethe file name to import.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > .
topbotomOrderif true, the point of coordinate (0,0) will be the bottom left corner image point (default) else the center of image coordinate will be the top left of the image (not usual).
Returns
an instance of the ImageContainer.
Examples
tutorial-examples/freemanChainFromImage.cpp.

Referenced by DGtal::GenericReader< TContainer, 2, TValue >::importWithValueFunctor(), DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithValueFunctor(), main(), testImageAdapter(), testPNMReader(), and testRWIssue254().

◆ importPGM3D()

template<typename TImageContainer , typename TFunctor = functors::Cast<typename TImageContainer::Value>>
static ImageContainer DGtal::PGMReader< TImageContainer, TFunctor >::importPGM3D ( const std::string &  aFilename,
const Functor aFunctor = Functor() 
)
static

Main method to import a Pgm3D (8bits) into an instance of the template parameter ImageContainer.

Parameters
aFilenamethe file name to import.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > .
Returns
an instance of the ImageContainer.

Referenced by DGtal::GenericReader< TContainer, 3, TValue >::importWithValueFunctor(), testPNM3DASCIIReader(), and testPNM3DReader().


The documentation for this struct was generated from the following file: