Fawkes API  Fawkes Development Version
firevision::Writer Class Referenceabstract

Interface to write images. More...

#include <>>

Inheritance diagram for firevision::Writer:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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

◆ Writer()

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

Constructor.

Parameters
extensionthe file extension

Definition at line 77 of file writer.cpp.

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

◆ ~Writer()

firevision::Writer::~Writer ( )
virtual

Virtual empty destructor.

Definition at line 94 of file writer.cpp.

References basename, extension, and filename.

Member Function Documentation

◆ set_buffer()

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

Set image buffer.

Parameters
cspacecolor space of image
bufferbuffer of image

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

Definition at line 143 of file writer.cpp.

References buffer, and cspace.

◆ set_dimensions()

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

Set dimensions of image in pixels.

Parameters
widthwidth of image in pixels
heightheight of image in pixels.

Reimplemented in firevision::FvRawWriter, and firevision::CompressedImageWriter.

Definition at line 132 of file writer.cpp.

References height, and width.

Referenced by firevision::SEGenerator::linear().

◆ set_extension()

void firevision::Writer::set_extension ( const char *  extension)
protectedvirtual

Set the filename extension for file written by this writer.

Parameters
extensionthe extension

Definition at line 153 of file writer.cpp.

References basename, and filename.

◆ set_filename()

void firevision::Writer::set_filename ( const char *  filename)
virtual

Set filename.

Parameters
filenamename 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(), and firevision::PNMWriter::PNMWriter().

◆ write()

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

Member Data Documentation

◆ basename

firevision::Writer::basename
protected

The basename of the file.

Definition at line 49 of file writer.h.

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

◆ buffer

◆ cspace

◆ extension

firevision::Writer::extension
protected

The extension of the file.

Definition at line 50 of file writer.h.

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

◆ filename

◆ height

◆ width


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