Fawkes API  Fawkes Development Version
writer.h
1 
2 /***************************************************************************
3  * writer.h - Writer interface
4  *
5  * Generated: Thu Jun 02 18:24:35 2005
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_FVUTILS_WRITERS_WRITER_H_
25 #define __FIREVISION_FVUTILS_WRITERS_WRITER_H_
26 
27 #include <fvutils/color/colorspaces.h>
28 
29 namespace firevision {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class Writer {
35 
36  public:
37  Writer(const char *extension = 0);
38  virtual ~Writer();
39 
40  virtual void set_filename(const char *filename);
41  virtual void set_dimensions(unsigned int width, unsigned int height);
42  virtual void set_buffer(colorspace_t cspace, unsigned char *buffer);
43  virtual void write() = 0;
44 
45  protected:
46  virtual void set_extension(const char *extension);
47 
48  char *filename;
49  char *basename;
50  char *extension;
51 
52  unsigned int width;
53  unsigned int height;
54 
55  colorspace_t cspace;
56 
57  unsigned char *buffer;
58 };
59 
60 } // end namespace firevision
61 
62 #endif
colorspace_t cspace
The colorspace of the image.
Definition: writer.h:55
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Definition: writer.cpp:143
virtual void set_extension(const char *extension)
Set the filename extension for file written by this writer.
Definition: writer.cpp:153
Interface to write images.
Definition: writer.h:34
virtual void write()=0
Write to file.
Writer(const char *extension=0)
Constructor.
Definition: writer.cpp:77
virtual ~Writer()
Virtual empty destructor.
Definition: writer.cpp:94
char * basename
The basename of the file.
Definition: writer.h:49
virtual void set_filename(const char *filename)
Set filename.
Definition: writer.cpp:106
char * extension
The extension of the file.
Definition: writer.h:50
unsigned int width
The width of the image.
Definition: writer.h:52
unsigned char * buffer
The image-buffer.
Definition: writer.h:57
unsigned int height
The height of the image.
Definition: writer.h:53
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
Definition: writer.cpp:132
char * filename
The complete filename.
Definition: writer.h:48