DGtal  1.5.beta
DGtal::STBWriter< TImageContainer, TFunctor > Class Template Reference

Aim: Image Writer using the stb_image.h header only code. More...

#include <DGtal/io/writers/STBWriter.h>

Public Types

typedef TImageContainer ImageContainer
 
typedef TImageContainer::Domain::Vector Vector
 
typedef TImageContainer::Value Value
 
typedef TFunctor Functor
 

Public Member Functions

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

Static Public Member Functions

static bool exportPNG (const std::string &filename, const ImageContainer &anImage, const Functor &aFunctor=Functor())
 
static bool exportTGA (const std::string &filename, const ImageContainer &anImage, const Functor &aFunctor=Functor())
 
static bool exportBMP (const std::string &filename, const ImageContainer &anImage, const Functor &aFunctor=Functor())
 
static bool exportJPG (const std::string &filename, const ImageContainer &anImage, const Functor &aFunctor=Functor(), int quality=70)
 

Detailed Description

template<typename TImageContainer, typename TFunctor = functors::Identity>
class DGtal::STBWriter< TImageContainer, TFunctor >

Aim: Image Writer using the stb_image.h header only code.

Description of template class 'STBWriter'

These methods export an image in various formats (png, jpg, tga, bmp) by first using the functor to convert the image values to colors.

Template Parameters
TImageContainerthe image type
TFunctorthe functor type that maps the image values to DGtal::Color

Definition at line 64 of file STBWriter.h.

Member Typedef Documentation

◆ Functor

template<typename TImageContainer , typename TFunctor = functors::Identity>
typedef TFunctor DGtal::STBWriter< TImageContainer, TFunctor >::Functor

Definition at line 71 of file STBWriter.h.

◆ ImageContainer

template<typename TImageContainer , typename TFunctor = functors::Identity>
typedef TImageContainer DGtal::STBWriter< TImageContainer, TFunctor >::ImageContainer

Definition at line 68 of file STBWriter.h.

◆ Value

template<typename TImageContainer , typename TFunctor = functors::Identity>
typedef TImageContainer::Value DGtal::STBWriter< TImageContainer, TFunctor >::Value

Definition at line 70 of file STBWriter.h.

◆ Vector

template<typename TImageContainer , typename TFunctor = functors::Identity>
typedef TImageContainer::Domain::Vector DGtal::STBWriter< TImageContainer, TFunctor >::Vector

Definition at line 69 of file STBWriter.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

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

◆ BOOST_STATIC_ASSERT()

template<typename TImageContainer , typename TFunctor = functors::Identity>
DGtal::STBWriter< TImageContainer, TFunctor >::BOOST_STATIC_ASSERT ( (ImageContainer::Domain::dimension==2)  )

◆ exportBMP()

template<typename TImageContainer , typename TFunctor = functors::Identity>
static bool DGtal::STBWriter< TImageContainer, TFunctor >::exportBMP ( const std::string &  filename,
const ImageContainer anImage,
const Functor aFunctor = Functor() 
)
static

Export an image as BMP

Parameters
filenamethe file name to export.
anImagethe image to export.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (Value -> DGtal::Color functor).
Returns
an instance of the ImageContainer.

◆ exportJPG()

template<typename TImageContainer , typename TFunctor = functors::Identity>
static bool DGtal::STBWriter< TImageContainer, TFunctor >::exportJPG ( const std::string &  filename,
const ImageContainer anImage,
const Functor aFunctor = Functor(),
int  quality = 70 
)
static

Export an image as JPG

Parameters
filenamethe file name to export.
anImagethe image to export.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (Value -> DGtal::Color functor).
qualitythe jpg compression quality (in [0,100], 100 is full quality, def = 70)
Returns
an instance of the ImageContainer.

◆ exportPNG()

template<typename TImageContainer , typename TFunctor = functors::Identity>
static bool DGtal::STBWriter< TImageContainer, TFunctor >::exportPNG ( const std::string &  filename,
const ImageContainer anImage,
const Functor aFunctor = Functor() 
)
static

Export an image as PNG

Parameters
filenamethe file name to export.
anImagethe image to export.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (Value -> DGtal::Color functor).
Returns
an instance of the ImageContainer.

◆ exportTGA()

template<typename TImageContainer , typename TFunctor = functors::Identity>
static bool DGtal::STBWriter< TImageContainer, TFunctor >::exportTGA ( const std::string &  filename,
const ImageContainer anImage,
const Functor aFunctor = Functor() 
)
static

Export an image as TGA

Parameters
filenamethe file name to export.
anImagethe image to export.
aFunctorthe functor used to import and cast the source image values into the type of the image container value (Value -> DGtal::Color functor).
Returns
an instance of the ImageContainer.

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