SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
slip::JpegReader< Container2d, T, Nb_components, Nb_block > Class Template Reference

JpegReader, inherited from ContainerReader, is a reader for jpeg images. More...

#include <JpegReader.hpp>

Inheritance diagram for slip::JpegReader< Container2d, T, Nb_components, Nb_block >:
Inheritance graph

Public Types

typedef Container2d container_type
 
typedef T value_type
 
typedef ContainerReader
< Container2d, T, Nb_block > 
base
 

Public Member Functions

void initialize ()
 initialized the reading process. More...
 
void release ()
 release the reading process. More...
 
int read (Container2d &in)
 virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1. More...
 
Constructors & Destructors
 JpegReader ()
 
 JpegReader (std::string data_filename)
 
virtual ~JpegReader ()
 
Getters and setters
const std::string & get_data_filename () const
 return the name of the file containing the data to read More...
 
void set_data_filename (const std::string &data_filename)
 
std::size_t get_nb_block () const
 return the number of splitting blocks of the data More...
 

Protected Attributes

std::string data_filename_
 

Detailed Description

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
class slip::JpegReader< Container2d, T, Nb_components, Nb_block >

JpegReader, inherited from ContainerReader, is a reader for jpeg images.

Version
Fluex 1.0
Date
2013/04/05
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
Container2dshould be a 2d Container with a component number equal to Nb_components.
Tthe type of the container data.
Nb_componentsthe number of image components (3 for a color image or 1 for a gray scale image).
Nb_blockis the number of containers to create (>1 if one want to split the input data into different containers, default is 1). Notice that the image data is always cut according to the rows dimension which must be the first dimension of the input container. In other words each container will contain a set of rows which size depends on the Nb_block.
Precondition
Container2d should have Nb_components components
Nb_components should be 1 or 3.
Axis conventions (dim1 = rows, dim2 = cols):
iterator2d_conventions.jpg
axis and notation conventions
Examples:
jpg_file_io.cpp.

Definition at line 45 of file JpegReader.hpp.

Member Typedef Documentation

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef ContainerReader<Container2d,T,Nb_block> slip::JpegReader< Container2d, T, Nb_components, Nb_block >::base

Definition at line 49 of file JpegReader.hpp.

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef Container2d slip::JpegReader< Container2d, T, Nb_components, Nb_block >::container_type

Definition at line 47 of file JpegReader.hpp.

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef T slip::JpegReader< Container2d, T, Nb_components, Nb_block >::value_type

Definition at line 48 of file JpegReader.hpp.

Constructor & Destructor Documentation

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
slip::JpegReader< Container2d, T, Nb_components, Nb_block >::JpegReader ( )
inline

Default constructor

Definition at line 59 of file JpegReader.hpp.

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
slip::JpegReader< Container2d, T, Nb_components, Nb_block >::JpegReader ( std::string  data_filename)
inline

Constructor with parameters.

Parameters
data_filenameis the name of the file containing the data to read
Note
this constructor automatically call the initialize() method.

Definition at line 68 of file JpegReader.hpp.

template<class Container2d, typename T, std::size_t Nb_components, std::size_t Nb_block>
virtual slip::JpegReader< Container2d, T, Nb_components, Nb_block >::~JpegReader ( )
inlinevirtual

Destructor

Note
the release() method is called.

Definition at line 78 of file JpegReader.hpp.

Member Function Documentation

const std::string& slip::ContainerReader< Container2d , T, Nb_block >::get_data_filename ( ) const
inherited

return the name of the file containing the data to read

std::size_t slip::ContainerReader< Container2d , T, Nb_block >::get_nb_block ( ) const
inherited

return the number of splitting blocks of the data

template<class Container2d , typename T , std::size_t Nb_components, std::size_t Nb_block>
void slip::JpegReader< Container2d, T, Nb_components, Nb_block >::initialize ( )
inline

initialized the reading process.

Note
an initialization is called by the JpegReader(std::string) constructor.

Definition at line 128 of file JpegReader.hpp.

template<class Container2d , typename T , std::size_t Nb_components, std::size_t Nb_block>
int slip::JpegReader< Container2d, T, Nb_components, Nb_block >::read ( Container2d &  in)
virtual

virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1.

Parameters
inis the container to fill. Warning, the container should be a 2d container with [] operator, resize(), width() and height() methods defined.
Returns
true if there is still data to read, false if the file has been completely read.

Implements slip::ContainerReader< Container2d, T, Nb_block >.

Definition at line 211 of file JpegReader.hpp.

template<class Container2d , typename T , std::size_t Nb_components, std::size_t Nb_block>
void slip::JpegReader< Container2d, T, Nb_components, Nb_block >::release ( )

release the reading process.

Note
this method is called by the destructor.

Definition at line 248 of file JpegReader.hpp.

void slip::ContainerReader< Container2d , T, Nb_block >::set_data_filename ( const std::string &  data_filename)
inherited
Parameters
data_filenameis the name of the file containing the data to read

Member Data Documentation

std::string slip::ContainerReader< Container2d , T, Nb_block >::data_filename_
protectedinherited

Definition at line 100 of file ContainerReader.hpp.


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