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::PngWriter< Container2d, T, Nb_components > Class Template Reference

PngWriter is the png image writer. More...

#include <PngWriter.hpp>

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

Public Types

typedef Container2d container_type
 
typedef T value_type
 
typedef ContainerWriter
< Container2d, T > 
base
 

Public Member Functions

void initialize (std::size_t output_image_width, std::size_t output_image_height)
 initialized the writing process. Has to be called before the first write() call of a given image. More...
 
void release ()
 release the writing process. Has to be called when an image has been fully written. More...
 
int write (const container_type &data)
 write function. This function write the data within the output file after the previous one. When last is set to true, the output file is closed. More...
 
Constructors & Destructors
 PngWriter ()
 
 PngWriter (std::string output_filename, std::size_t output_image_width, std::size_t output_image_height)
 
virtual ~PngWriter ()
 
Getters and setters
const std::string & get_output_filename () const
 return the output file name. More...
 
void set_output_filename (const std::string &output_filename)
 set the output file name. More...
 

Protected Attributes

std::string output_filename_
 

Detailed Description

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

PngWriter is the png image writer.

Version
Fluex 1.0
Date
2013/04/22
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
Container2dis the type of the containers that will be written in the png file. It should be a 2 dimensional containers with [] operator, width() and height() methods defined.
Tthe type of the container data.
Nb_componentsthe number of image components (3 for a color image or 1 for a gray scale image).
Note
The color space is RGB for color image and GRAYSCALE for grayscale images.
Examples:
netcdf_file_io.cpp.

Definition at line 43 of file PngWriter.hpp.

Member Typedef Documentation

template<class Container2d, typename T, std::size_t Nb_components>
typedef ContainerWriter<Container2d, T> slip::PngWriter< Container2d, T, Nb_components >::base

Definition at line 48 of file PngWriter.hpp.

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

Definition at line 46 of file PngWriter.hpp.

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

Definition at line 47 of file PngWriter.hpp.

Constructor & Destructor Documentation

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

Default constructor

Definition at line 58 of file PngWriter.hpp.

template<class Container2d, typename T, std::size_t Nb_components>
slip::PngWriter< Container2d, T, Nb_components >::PngWriter ( std::string  output_filename,
std::size_t  output_image_width,
std::size_t  output_image_height 
)
inline

Constructor with parameters.

Parameters
output_filenameis the name of the output file where the data of the container will be saved
output_image_widththe total image width
output_image_heightthe total image height
qualityis the compression rate (default is 90%)

Definition at line 72 of file PngWriter.hpp.

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

Destructor

Definition at line 81 of file PngWriter.hpp.

Member Function Documentation

const std::string& slip::ContainerWriter< Container2d , T >::get_output_filename ( ) const
inherited

return the output file name.

template<class Container2d , typename T , std::size_t Nb_components>
void slip::PngWriter< Container2d, T, Nb_components >::initialize ( std::size_t  output_image_width,
std::size_t  output_image_height 
)
inline

initialized the writing process. Has to be called before the first write() call of a given image.

Parameters
output_image_widththe total image width
output_image_heightthe total image height

Definition at line 134 of file PngWriter.hpp.

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

release the writing process. Has to be called when an image has been fully written.

Definition at line 280 of file PngWriter.hpp.

void slip::ContainerWriter< Container2d , T >::set_output_filename ( const std::string &  output_filename)
inherited

set the output file name.

template<class Container2d , typename T , std::size_t Nb_components>
int slip::PngWriter< Container2d, T, Nb_components >::write ( const container_type data)
inlinevirtual

write function. This function write the data within the output file after the previous one. When last is set to true, the output file is closed.

Parameters
datais the image container to save. Warning, the container should be a 2d container with [] operator, width() and height() methods defined.
Returns
false if the file has been completely filled.
Note
Whatever the type of the data in the container, a static_cast is done for getting unsigned char. Be sure that the dynamic of the data is conform with this cast.
The color space is RGB for color image and GRAYSCALE for grayscale images.

Implements slip::ContainerWriter< Container2d, T >.

Definition at line 235 of file PngWriter.hpp.

Member Data Documentation

std::string slip::ContainerWriter< Container2d , T >::output_filename_
protectedinherited

Definition at line 89 of file ContainerWriter.hpp.


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