Writer Class Reference

Interface to write images. More...

#include <fvutils/writers/writer.h>

Inheritance diagram for Writer:

List of all members.


Public Member Functions

 Writer (const char *extension=0)
 Constructor.
virtual ~Writer ()
 Virtual empty destructor.
virtual void set_filename (const char *filename)
 Set filename.
virtual void set_dimensions (unsigned int width, unsigned int height)
 Set dimensions of image in pixels.
virtual void set_buffer (colorspace_t cspace, unsigned char *buffer)
 Set image buffer.
virtual void write ()=0
 Write to file.

Protected Member Functions

virtual void set_extension (const char *extension)
 Set the filename extension for file written by this writer.

Protected Attributes

char * filename
 The complete filename.
char * basename
 The basename of the file.
char * extension
 The extension of the file.
unsigned int width
 The width of the image.
unsigned int height
 The height of the image.
colorspace_t cspace
 The colorspace of the image.
unsigned char * buffer
 The image-buffer.

Detailed Description

Interface to write images.

The writer interface defines the general API for image writers. These writers are used to write images to files on your harddrive (like JPEGs, PNGs etc.).

Author:
Tim Niemueller

Definition at line 29 of file writer.h.


Constructor & Destructor Documentation

Writer::Writer ( const char *  extension = 0  ) 

Constructor.

Parameters:
extension the file extension

Definition at line 72 of file writer.cpp.

References basename, buffer, cspace, filename, height, and width.

Writer::~Writer (  )  [virtual]

Virtual empty destructor.

Definition at line 89 of file writer.cpp.

References basename, extension, and filename.


Member Function Documentation

void Writer::set_buffer ( colorspace_t  cspace,
unsigned char *  buffer 
) [virtual]

Set image buffer.

Parameters:
cspace color space of image
buffer buffer of image

Reimplemented in CompressedImageWriter, FvRawWriter, JpegWriter, PNGWriter, and PNMWriter.

Definition at line 138 of file writer.cpp.

Referenced by SeqWriter::write().

void Writer::set_dimensions ( unsigned int  width,
unsigned int  height 
) [virtual]

Set dimensions of image in pixels.

Parameters:
width width of image in pixels
height height of image in pixels.

Reimplemented in CompressedImageWriter, and FvRawWriter.

Definition at line 127 of file writer.cpp.

Referenced by SEGenerator::linear(), and SeqWriter::set_dimensions().

void Writer::set_extension ( const char *  extension  )  [protected, virtual]

Set the filename extension for file written by this writer.

Parameters:
extension the extension

Definition at line 148 of file writer.cpp.

References basename, and filename.

void Writer::set_filename ( const char *  filename  )  [virtual]

Set filename.

Parameters:
filename name of file to write to. This can either be the complete filename (including) extension or the basename only in which case the extension is added.

Reimplemented in CompressedImageWriter.

Definition at line 101 of file writer.cpp.

References basename, and extension.

Referenced by FvRawWriter::FvRawWriter(), JpegWriter::JpegWriter(), SEGenerator::linear(), PNGWriter::PNGWriter(), PNMWriter::PNMWriter(), and SeqWriter::write().

void Writer::write (  )  [pure virtual]

Write to file.

Implemented in CompressedImageWriter, FvRawWriter, JpegWriter, PNGWriter, and PNMWriter.

Referenced by SeqWriter::write().


Member Data Documentation

Writer::basename [protected]

The basename of the file.

Definition at line 44 of file writer.h.

Referenced by set_extension(), set_filename(), Writer(), and ~Writer().

Writer::cspace [protected]

The colorspace of the image.

Definition at line 50 of file writer.h.

Referenced by CompressedImageWriter::CompressedImageWriter(), CompressedImageWriter::set_image_compressor(), and Writer().

Writer::extension [protected]

The extension of the file.

Definition at line 45 of file writer.h.

Referenced by set_filename(), and ~Writer().


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