DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::PPMReader< TImageContainer, TFunctor > Struct Template Reference

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

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

Public Types

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

Public Member Functions

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

Static Public Member Functions

static ImageContainer importPPM (const std::string &aFilename, const Functor &aFunctor=functors::ColorRGBEncoder< Value >(), bool topbotomOrder=true)
 

Detailed Description

template<typename TImageContainer, typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
struct DGtal::PPMReader< TImageContainer, TFunctor >

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

Description of class 'PPMReader'

Template Parameters
TImageContainerthe type of the image container
TFunctorthe type of the functor to transform the source image color into scalar value. This functor should follows the concept CUnaryFunctor<TFunctor, DGtal::Color, TImageContainer::Value>

Definition at line 98 of file PPMReader.h.

Member Typedef Documentation

◆ Functor

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
typedef TFunctor DGtal::PPMReader< TImageContainer, TFunctor >::Functor

Definition at line 106 of file PPMReader.h.

◆ ImageContainer

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
typedef TImageContainer DGtal::PPMReader< TImageContainer, TFunctor >::ImageContainer

Definition at line 103 of file PPMReader.h.

◆ Value

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
typedef TImageContainer::Value DGtal::PPMReader< TImageContainer, TFunctor >::Value

Definition at line 105 of file PPMReader.h.

◆ Vector

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
typedef TImageContainer::Domain::Vector DGtal::PPMReader< TImageContainer, TFunctor >::Vector

Definition at line 104 of file PPMReader.h.

Member Enumeration Documentation

◆ MagicNumber

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

Definition at line 108 of file PPMReader.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
DGtal::PPMReader< TImageContainer, TFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< TFunctor, DGtal::Color, Value >) )

◆ BOOST_STATIC_ASSERT()

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

◆ importPPM()

template<typename TImageContainer , typename TFunctor = functors::ColorRGBEncoder<typename TImageContainer::Value>>
static ImageContainer DGtal::PPMReader< TImageContainer, TFunctor >::importPPM ( const std::string & aFilename,
const Functor & aFunctor = functors::ColorRGBEncoderValue >(),
bool topbotomOrder = true )
static

Main method to import a PPM (24bit, 8bits per channel) into an instance of the template parameter ImageContainer.

Parameters
aFilenamethe file name to import.
aFunctorthe functor that from a given color return it associated code (by default set to BasicColorToScalarFunctors::ColorRGBEncoder).
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.

Referenced by DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithColorFunctor(), DGtal::GenericReader< TContainer, 2, TValue >::importWithColorFunctor(), and testPNMReader().


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