Fawkes API  Fawkes Development Version
fvraw.h
1 
2 /***************************************************************************
3  * fvraw.h - writer for FireVision raw files
4  *
5  * Generated: Sat Mar 25 00:05:26 2006
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_FVRAW_H_
25 #define __FIREVISION_FVUTILS_WRITERS_FVRAW_H_
26 
27 #include <fvutils/writers/writer.h>
28 
29 namespace firevision {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class FvRawWriter : public Writer {
35 
36  public:
37  FvRawWriter();
38  FvRawWriter(const char *filename,
39  unsigned int width, unsigned int height);
40  FvRawWriter(const char *filename,
41  unsigned int width, unsigned int height,
42  colorspace_t colorspace, unsigned char *buffer);
43  virtual ~FvRawWriter();
44 
45  virtual void set_dimensions(unsigned int width, unsigned int height);
46  virtual void set_buffer(colorspace_t cspace, unsigned char *buffer);
47  virtual void write();
48  virtual unsigned char * get_write_buffer();
49 
50  static const unsigned int FILE_IDENTIFIER;
51 
52  /** FvRaw image file header. */
53  typedef struct {
54  unsigned int file_id; /**< file id */
55  colorspace_t colorspace; /**< color space */
56  unsigned int width; /**< width of image in pixels */
57  unsigned int height; /**< height of image in pixels */
58  } FvRawHeader;
59 
60  private:
61  FvRawHeader header;
62  unsigned char *buffer;
63 
64 };
65 
66 } // end namespace firevision
67 
68 #endif
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Definition: fvraw.cpp:120
colorspace_t cspace
The colorspace of the image.
Definition: writer.h:55
FvRaw image file header.
Definition: fvraw.h:53
Interface to write images.
Definition: writer.h:34
static const unsigned int FILE_IDENTIFIER
File identifier for FvRaw images.
Definition: fvraw.h:50
FvRaw Writer implementation.
Definition: fvraw.h:34
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
Definition: fvraw.cpp:112
unsigned int file_id
file id
Definition: fvraw.h:54
unsigned int height
height of image in pixels
Definition: fvraw.h:57
virtual void write()
Write to file.
Definition: fvraw.cpp:128
colorspace_t colorspace
color space
Definition: fvraw.h:55
unsigned int width
width of image in pixels
Definition: fvraw.h:56
virtual ~FvRawWriter()
Destructor.
Definition: fvraw.cpp:106
virtual unsigned char * get_write_buffer()
Get write buffer.
Definition: fvraw.cpp:174
unsigned int width
The width of the image.
Definition: writer.h:52
unsigned int height
The height of the image.
Definition: writer.h:53
FvRawWriter()
Constructor.
Definition: fvraw.cpp:50
char * filename
The complete filename.
Definition: writer.h:48