Public Types | Public Member Functions | Static Public Member Functions

DGtal::PNMWriter< TImage, TColormap > Struct Template Reference

Aim: Export a 2D and a 3D Image using the Netpbm formats (ASCII mode).

More...

#include <PNMWriter.h>

Public Types

typedef TImage Image
typedef TImage::ValueType ValueType
typedef TColormap Colormap

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CColorMap< TColormap >))
 BOOST_STATIC_ASSERT ((TImage::Domain::staticDimension==2)||(TImage::Domain::staticDimension==3))
 BOOST_STATIC_ASSERT ((boost::is_same< typename TColormap::ValueType, typename TImage::ValueType >::value))

Static Public Member Functions

static bool exportPPM (const std::string &filename, const Image &aImage, const ValueType &minV, const ValueType &maxV)
static bool exportPPM3D (const std::string &filename, const Image &aImage, const ValueType &minV, const ValueType &maxV)
static bool exportPGM (const std::string &filename, const Image &aImage, const ValueType &minV, const ValueType &maxV)
static bool exportPGM3D (const std::string &filename, const Image &aImage, const ValueType &minV, const ValueType &maxV)

Detailed Description

template<typename TImage, typename TColormap>
struct DGtal::PNMWriter< TImage, TColormap >

Aim: Export a 2D and a 3D Image using the Netpbm formats (ASCII mode).

Description of template struct 'PNMWriter'

Usage example:

 ...
 typedef SpaceND<int,2> TSpace;
 typedef TSpace::Point Point;
 typedef HyperRectDomain<TSpace> Domain;
 typedef HueShadeColorMap<unsigned char> Hue;
 typedef ImageSelector<Domain, unsigned char>::Type Image;
 ...
 Point a ( 1, 1);
 Point b ( 16, 16);
 Image image(a,b);
 ... //Do something in image
 PNMWriter<Image,Hue>::exportPPM("export-hue.ppm",image,0,255);
Template Parameters:
TImage the Image type.
TColormap the type of the colormap to use in the export.
Todo:
check if a magick number exists for PGM3D/PPM3D.

Member Typedef Documentation

template<typename TImage , typename TColormap >
typedef TColormap DGtal::PNMWriter< TImage, TColormap >::Colormap
template<typename TImage , typename TColormap >
typedef TImage DGtal::PNMWriter< TImage, TColormap >::Image
template<typename TImage , typename TColormap >
typedef TImage::ValueType DGtal::PNMWriter< TImage, TColormap >::ValueType

Member Function Documentation

template<typename TImage , typename TColormap >
DGtal::PNMWriter< TImage, TColormap >::BOOST_CONCEPT_ASSERT ( (CColorMap< TColormap >)   ) 
template<typename TImage , typename TColormap >
DGtal::PNMWriter< TImage, TColormap >::BOOST_STATIC_ASSERT ( (TImage::Domain::staticDimension==2)||(TImage::Domain::staticDimension==3)   ) 
template<typename TImage , typename TColormap >
DGtal::PNMWriter< TImage, TColormap >::BOOST_STATIC_ASSERT ( (boost::is_same< typename TColormap::ValueType, typename TImage::ValueType >::value)   ) 
template<typename TImage , typename TColormap >
static bool DGtal::PNMWriter< TImage, TColormap >::exportPGM ( const std::string &  filename,
const Image aImage,
const ValueType minV,
const ValueType maxV 
) [static]

Export an Image with PGM format. The colormap specified in the template arguments is used to convert ValueType to RBG colors. Then, a RGB to Grayscale conversion is performed.

Parameters:
filename name of the output file
aImage the image to export
minV the minimum value of aImage (for colormap)
maxV the maximum value of aImage (for colormap)
Returns:
true if no errors occur.
template<typename TImage , typename TColormap >
static bool DGtal::PNMWriter< TImage, TColormap >::exportPGM3D ( const std::string &  filename,
const Image aImage,
const ValueType minV,
const ValueType maxV 
) [static]

Export an Image with PGM3D format. The colormap specified in the template arguments is used to convert ValueType to RBG colors. Then, a RGB to Grayscale conversion is performed.

Parameters:
filename name of the output file
aImage the image to export
minV the minimum value of aImage (for colormap)
maxV the maximum value of aImage (for colormap)
Returns:
true if no errors occur.
template<typename TImage , typename TColormap >
static bool DGtal::PNMWriter< TImage, TColormap >::exportPPM ( const std::string &  filename,
const Image aImage,
const ValueType minV,
const ValueType maxV 
) [static]

Export an Image with PPM format. The colormap specified in the template arguments is used to convert ValueType to RBG colors.

Parameters:
filename name of the output file
aImage the image to export
minV the minimum value of aImage (for colormap)
maxV the maximum value of aImage (for colormap)
Returns:
true if no errors occur.
template<typename TImage , typename TColormap >
static bool DGtal::PNMWriter< TImage, TColormap >::exportPPM3D ( const std::string &  filename,
const Image aImage,
const ValueType minV,
const ValueType maxV 
) [static]

Export an Image with PPM3Dformat. The colormap specified in the template arguments is used to convert ValueType to RBG colors.

Parameters:
filename name of the output file
aImage the image to export
minV the minimum value of aImage (for colormap)
maxV the maximum value of aImage (for colormap)
Returns:
true if no errors occur.

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