Public Member Functions | Protected Member Functions | Protected Attributes

firevision::Writer Class Reference

Interface to write images. More...

#include <>>

Inheritance diagram for firevision::Writer:
Inheritance graph
[legend]

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 34 of file writer.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
extension the file extension

Definition at line 77 of file writer.cpp.

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

firevision::Writer::~Writer (  )  [virtual]

Virtual empty destructor.

Definition at line 94 of file writer.cpp.

References basename, extension, and filename.


Member Function Documentation

void firevision::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 firevision::CompressedImageWriter, firevision::FvRawWriter, firevision::JpegWriter, firevision::PNGWriter, and firevision::PNMWriter.

Definition at line 143 of file writer.cpp.

Referenced by firevision::SeqWriter::write().

void firevision::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 firevision::CompressedImageWriter, and firevision::FvRawWriter.

Definition at line 132 of file writer.cpp.

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

void firevision::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 153 of file writer.cpp.

References basename, and filename.

void firevision::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 firevision::CompressedImageWriter.

Definition at line 106 of file writer.cpp.

References basename, and extension.

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

void firevision::Writer::write (  )  [pure virtual]

Member Data Documentation

The basename of the file.

Definition at line 49 of file writer.h.

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

The extension of the file.

Definition at line 50 of file writer.h.

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


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