Image Component Library (ICL)
|
File Writer implementation writing images to the hard disc. More...
#include <FileWriter.h>
Public Member Functions | |
FileWriter () | |
creates an empty file writer More... | |
FileWriter (const std::string &filepattern) | |
Creates a new filewriter with given filepattern. More... | |
FileWriter (const FilenameGenerator &gen) | |
Creates a new FileWriter with given FilenameGenerator. More... | |
~FileWriter () | |
Destructor. More... | |
const FilenameGenerator & | getFilenameGenerator () const |
returns the wrapped filename generator reference More... | |
void | write (const core::ImgBase *image) |
writes the next image More... | |
virtual void | send (const core::ImgBase *image) |
wraps write to implement ImageOutput interface More... | |
FileWriter & | operator<< (const core::ImgBase *image) |
as write but in stream manner More... | |
void | setOption (const std::string &option, const std::string &value) |
sets a core::format specific option More... | |
Public Member Functions inherited from icl::io::ImageOutput | |
virtual | ~ImageOutput () |
virtual destructor More... | |
virtual CompressionSpec | getCompression () const |
provide the protectedly inherited image compressor options here More... | |
virtual void | setCompression (const CompressionSpec &spec) |
provide the protectedly inherited image compressor options here More... | |
Private Attributes | |
FilenameGenerator | m_oGen |
internal generator for new filenames More... | |
Static Private Attributes | |
static std::map< std::string, FileWriterPlugin * > | s_mapPlugins |
static map of writer plugins More... | |
Friends | |
class | FileWriterPluginMapInitializer |
initializer class More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::io::ImageCompressor | |
Header | uncompressHeader (const icl8u *compressedData, int len) |
only decodes an image header More... | |
Header | createHeader (const core::ImgBase *image, bool skipMetaData) |
creates a header for a given image (not data will be null) More... | |
ImageCompressor (const CompressionSpec &spec=CompressionSpec("none")) | |
Creates an image Compressor with given compression mode. More... | |
~ImageCompressor () | |
Destructor. More... | |
virtual void | setCompression (const CompressionSpec &spec) |
string based interface for setting the compression mode More... | |
virtual CompressionSpec | getCompression () const |
can be implemented for returning the current compression mode More... | |
utils::Time | pickTimeStamp (const icl8u *compressedData) |
this can help to find out wheter the data is new and must be encoded More... | |
const CompressedData | compress (const core::ImgBase *image, bool skipMetaData=false) |
encodes a given image into the compressed code More... | |
const core::ImgBase * | uncompress (const icl8u *compressedData, int len, core::ImgBase **dst=0) |
decodes the given byte segment More... | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
File Writer implementation writing images to the hard disc.
The implementation has been re-designed to provide a structured more flexible plugin based interface for writing images using most different file formats. Currently the following formats are supported:
All supported file formats (except jpg) can be written/read as gzipped file. This feature is available if the libz is found by the makefile system, which automatically defines the -DWITH_ZLIB_SUPPORT then. To write a file with zip compression, you just have to add an additional ".gz"-suffix to the file name.
Dependent on the particular core::format, the IO process needs a larger or smaller amount of time. The following table shows a summary of the I/O Times. The times are taken on a 1.6GHz pentium-m notebook, so the actual times may fluctuate:
Writing (gz) | Reading (gz) | File-utils::Size (640x480-Parrot) (gz) | |
ppm | 10ms (100ms) | 6ms (25ms) | 901K (545K) |
pnm | 10ms (100ms) | 6ms (25ms) | 901K (545K) |
pgm | 7ms (120ms) | 7ms (25ms) | 901K (562K) |
icl | 4ms (122ms) | 7ms (26ms) | 901K (562K) |
csv | 800ms (1800ms) | 780ms (820ms) | 2901K (690K) |
jpg 10% | 5ms (not supported) | 5ms (not supported) | 15K (not supported) |
jpg 50% | 6ms (not supported) | 5ms (not supported) | 41K (not supported) |
jpg 90% | 5ms (not supported) | 5ms (not supported) | 101K (not supported) |
jpg 100% | 7ms (not supported) | 3ms (not supported) | 269K (not supported) |
The following example illustrates using the file writer:
icl::io::FileWriter::FileWriter | ( | ) |
creates an empty file writer
icl::io::FileWriter::FileWriter | ( | const std::string & | filepattern | ) |
Creates a new filewriter with given filepattern.
filepattern | this string is passed to the member FilenameGenerator |
icl::io::FileWriter::FileWriter | ( | const FilenameGenerator & | gen | ) |
Creates a new FileWriter with given FilenameGenerator.
icl::io::FileWriter::~FileWriter | ( | ) |
Destructor.
const FilenameGenerator& icl::io::FileWriter::getFilenameGenerator | ( | ) | const |
returns the wrapped filename generator reference
FileWriter& icl::io::FileWriter::operator<< | ( | const core::ImgBase * | image | ) |
as write but in stream manner
|
inlinevirtual |
wraps write to implement ImageOutput interface
Implements icl::io::ImageOutput.
void icl::io::FileWriter::setOption | ( | const std::string & | option, |
const std::string & | value | ||
) |
sets a core::format specific option
currently allowed options are:
void icl::io::FileWriter::write | ( | const core::ImgBase * | image | ) |
writes the next image
|
friend |
initializer class
|
private |
internal generator for new filenames
|
staticprivate |
static map of writer plugins