#include <DGtal/io/readers/GenericReader.h>
|
static TContainer | import (const std::string &filename, unsigned int x=0, unsigned int y=0) |
|
template<typename TFunctor > |
static TContainer | importWithColorFunctor (const std::string &filename, const TFunctor &aFunctor, unsigned int x=0, unsigned int y=0) |
|
template<typename TFunctor > |
static TContainer | importWithValueFunctor (const std::string &filename, const TFunctor &aFunctor, unsigned int x=0, unsigned int y=0) |
|
template<typename TContainer>
struct DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >
GenericReader Template partial specialisation for volume images of dimension 2 with DGtal::uint32_t values
Definition at line 520 of file GenericReader.h.
◆ BOOST_CONCEPT_ASSERT()
template<typename TContainer >
◆ import()
template<typename TContainer >
Import a volume image file. For the special format h5 (you need to set WITH_HDF5 of cmake build), the default parameter datasetName needs to be updated according to the dimension if the image.
- Parameters
-
filename | the image filename to be imported. |
x | specify the x image size to be used with raw format. |
y | specify the y image size to be used with raw format. |
◆ importWithColorFunctor()
template<typename TContainer >
template<typename TFunctor >
static TContainer DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithColorFunctor |
( |
const std::string & |
filename, |
|
|
const TFunctor & |
aFunctor, |
|
|
unsigned int |
x = 0 , |
|
|
unsigned int |
y = 0 |
|
) |
| |
|
inlinestatic |
Import an image file by specifying a color encoder functor (used only for color image format ppm, ( gif, jpeg, ... if the magick image lib is installed) .
- Template Parameters
-
TFunctor | The type of the functor (should verify the concept CUnaryFunctor<TFunctor, TContainer::Value, DGtal::Color > ). |
- Parameters
-
filename | the image filename to be imported. |
aFunctor | an ColorRGBEncoder. The type of the functor (should verify the concept CUnaryFunctor<TFunctor, TContainer::Value, DGtal::Color > ). |
x | specify the x image size to be used with raw format. |
y | specify the y image size to be used with raw format. |
Definition at line 552 of file GenericReader.h.
557 BOOST_CONCEPT_ASSERT(( concepts::CUnaryFunctor<TFunctor, DGtal::Color, typename TContainer::Value> )) ;
560 const std::string extension = filename.substr(filename.find_last_of(
".") + 1);
562 if ( extension ==
"ppm" )
566 else if ( extension ==
"raw" )
568 ASSERT( x != 0 && y != 0 );
570 return RawReader< TContainer, TFunctor >::template importRaw<DGtal::Color>( filename, pt, aFunctor);
572 else if ( extension ==
"gif" || extension ==
"jpg" || extension ==
"png" || extension ==
"jpeg" || extension ==
"bmp" )
575 MagickReader<TContainer, TFunctor> reader;
576 return reader.importImage( filename, aFunctor );
578 trace.
error() <<
"Extension " << extension<<
" not yet implemented in DGtal but you can add Magick option to deal with this image type." << std::endl;
583 trace.
error() <<
"Extension " << extension<<
" not yet implemented in DGtal GenericReader." << std::endl;
BOOST_CONCEPT_ASSERT((concepts::CImage< TContainer >))
static ImageContainer importPPM(const std::string &aFilename, const Functor &aFunctor=functors::ColorRGBEncoder< Value >(), bool topbotomOrder=true)
References DGtal::GenericReader< TContainer, Tdim, TValue >::BOOST_CONCEPT_ASSERT(), DGtal::Trace::error(), DGtal::MagickReader< TImageContainer, TFunctor >::importImage(), DGtal::PPMReader< TImageContainer, TFunctor >::importPPM(), and DGtal::trace.
◆ importWithValueFunctor()
template<typename TContainer >
template<typename TFunctor >
static TContainer DGtal::GenericReader< TContainer, 2, DGtal::uint32_t >::importWithValueFunctor |
( |
const std::string & |
filename, |
|
|
const TFunctor & |
aFunctor, |
|
|
unsigned int |
x = 0 , |
|
|
unsigned int |
y = 0 |
|
) |
| |
|
inlinestatic |
Import an image file by specifying a value functor used for grayscale image.
- Template Parameters
-
TFunctor | The type of the functor (should verify the concept CUnaryFunctor<TFunctor, unsigned char, TContainer::Value > ). |
- Parameters
-
filename | the image filename to be imported. |
aFunctor | to transform input unsigned char of image value into the given image type. |
x | specify the x image size to be used with raw format. |
y | specify the y image size to be used with raw format. |
Definition at line 599 of file GenericReader.h.
603 BOOST_CONCEPT_ASSERT(( concepts::CUnaryFunctor<TFunctor, unsigned char, typename TContainer::Value > )) ;
607 const std::string extension = filename.substr(filename.find_last_of(
".") + 1);
609 if ( extension ==
"raw" )
611 ASSERT( x != 0 && y != 0);
615 else if ( extension ==
"pgm ")
625 trace.
error() <<
"Extension " << extension<<
" not yet implemented in DGtal GenericReader." << std::endl;
static ImageContainer importHDF5(const std::string &aFilename, const std::string &aDataset, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
static ImageContainer importRaw8(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
References DGtal::GenericReader< TContainer, Tdim, TValue >::BOOST_CONCEPT_ASSERT(), DGtal::Trace::error(), DGtal::HDF5Reader< TImageContainer, TFunctor >::importHDF5(), DGtal::PGMReader< TImageContainer, TFunctor >::importPGM(), DGtal::RawReader< TImageContainer, TFunctor >::importRaw8(), and DGtal::trace.
The documentation for this struct was generated from the following file: