JpegWriter is the jpeg image writer.
More...
#include <JpegWriter.hpp>
|
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...
|
|
|
| JpegWriter () |
|
| JpegWriter (std::string output_filename, std::size_t output_image_width, std::size_t output_image_height, int quality=90) |
|
virtual | ~JpegWriter () |
|
|
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...
|
|
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
-
Container2d | is 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. |
T | the type of the container data. |
Nb_components | the 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.
template<class Container2d , typename T , std::size_t Nb_components>
template<class Container2d , typename T , std::size_t Nb_components>
template<class Container2d , typename T , std::size_t Nb_components>
template<class Container2d , typename T , std::size_t Nb_components>
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_filename | is the name of the output file where the data of the container will be saved |
output_image_width | the total image width |
output_image_height | the total image height |
quality | is the compression rate (default is 90%) |
Definition at line 72 of file JpegWriter.hpp.
template<class Container2d , typename T , std::size_t Nb_components>
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_width | the total image width |
output_image_height | the total image height |
quality | is the compression rate (default is 90%) |
Definition at line 135 of file JpegWriter.hpp.
template<class Container2d , typename T , std::size_t Nb_components>
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>
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
-
data | is 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.
The documentation for this class was generated from the following file: