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

JpegWriter is the jpeg image writer. More...

#include <JpegWriter.hpp>

Inheritance diagram for slip::JpegWriter< 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, int quality=90)
 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
 JpegWriter ()
 
 JpegWriter (std::string output_filename, std::size_t output_image_width, std::size_t output_image_height, int quality=90)
 
virtual ~JpegWriter ()
 
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::JpegWriter< Container2d, T, Nb_components >

JpegWriter is the jpeg image writer.

Version
Fluex 1.0
Date
2013/04/09
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
Container2dis the type of the containers that will be written in the jpeg 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:
jpg_file_io.cpp.

Definition at line 45 of file JpegWriter.hpp.

Member Typedef Documentation

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

Definition at line 49 of file JpegWriter.hpp.

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

Definition at line 47 of file JpegWriter.hpp.

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

Definition at line 48 of file JpegWriter.hpp.

Constructor & Destructor Documentation

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

Default constructor

Definition at line 59 of file JpegWriter.hpp.

template<class Container2d , typename T , std::size_t Nb_components>
slip::JpegWriter< Container2d, T, Nb_components >::JpegWriter ( std::string  output_filename,
std::size_t  output_image_width,
std::size_t  output_image_height,
int  quality = 90 
)
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 JpegWriter.hpp.

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

Destructor

Definition at line 82 of file JpegWriter.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::JpegWriter< Container2d, T, Nb_components >::initialize ( std::size_t  output_image_width,
std::size_t  output_image_height,
int  quality = 90 
)
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
qualityis the compression rate (default is 90%)

Definition at line 135 of file JpegWriter.hpp.

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

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

Definition at line 251 of file JpegWriter.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::JpegWriter< 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 214 of file JpegWriter.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: