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 
31 class Writer
32 {
33 public:
34  Writer(const char *extension = 0);
35  virtual ~Writer();
36 
37  virtual void set_filename(const char *filename);
38  virtual void set_dimensions(unsigned int width, unsigned int height);
39  virtual void set_buffer(colorspace_t cspace, unsigned char *buffer);
40  virtual void write() = 0;
41 
42 protected:
43  virtual void set_extension(const char *extension);
44 
45  char *filename;
46  char *basename;
47  char *extension;
48 
49  unsigned int width;
50  unsigned int height;
51 
52  colorspace_t cspace;
53 
54  unsigned char *buffer;
55 };
56 
57 } // end namespace firevision
58 
59 #endif
Interface to write images.
Definition: writer.h:32
unsigned int width
The width of the image.
Definition: writer.h:49
virtual void set_extension(const char *extension)
Set the filename extension for file written by this writer.
Definition: writer.cpp:149
char * basename
The basename of the file.
Definition: writer.h:46
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
Definition: writer.cpp:128
colorspace_t cspace
The colorspace of the image.
Definition: writer.h:52
virtual void write()=0
Write to file.
virtual void set_filename(const char *filename)
Set filename.
Definition: writer.cpp:102
char * extension
The extension of the file.
Definition: writer.h:47
unsigned char * buffer
The image-buffer.
Definition: writer.h:54
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Definition: writer.cpp:139
unsigned int height
The height of the image.
Definition: writer.h:50
char * filename
The complete filename.
Definition: writer.h:45
virtual ~Writer()
Virtual empty destructor.
Definition: writer.cpp:90
Writer(const char *extension=0)
Constructor.
Definition: writer.cpp:73