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 
31 class FvRawWriter : public Writer
32 {
33 public:
34  FvRawWriter();
35  FvRawWriter(const char *filename, unsigned int width, unsigned int height);
36  FvRawWriter(const char * filename,
37  unsigned int width,
38  unsigned int height,
39  colorspace_t colorspace,
40  unsigned char *buffer);
41  virtual ~FvRawWriter();
42 
43  virtual void set_dimensions(unsigned int width, unsigned int height);
44  virtual void set_buffer(colorspace_t cspace, unsigned char *buffer);
45  virtual void write();
46  virtual unsigned char *get_write_buffer();
47 
48  static const unsigned int FILE_IDENTIFIER;
49 
50  /** FvRaw image file header. */
51  typedef struct
52  {
53  unsigned int file_id; /**< file id */
54  colorspace_t colorspace; /**< color space */
55  unsigned int width; /**< width of image in pixels */
56  unsigned int height; /**< height of image in pixels */
57  } FvRawHeader;
58 
59 private:
60  FvRawHeader header;
61  unsigned char *buffer;
62 };
63 
64 } // end namespace firevision
65 
66 #endif
FvRaw Writer implementation.
Definition: fvraw.h:32
static const unsigned int FILE_IDENTIFIER
File identifier for FvRaw images.
Definition: fvraw.h:48
FvRawWriter()
Constructor.
Definition: fvraw.cpp:46
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
Definition: fvraw.cpp:104
virtual void write()
Write to file.
Definition: fvraw.cpp:118
virtual unsigned char * get_write_buffer()
Get write buffer.
Definition: fvraw.cpp:160
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Definition: fvraw.cpp:111
virtual ~FvRawWriter()
Destructor.
Definition: fvraw.cpp:99
Interface to write images.
Definition: writer.h:32
unsigned int width
The width of the image.
Definition: writer.h:49
colorspace_t cspace
The colorspace of the image.
Definition: writer.h:52
unsigned int height
The height of the image.
Definition: writer.h:50
char * filename
The complete filename.
Definition: writer.h:45
FvRaw image file header.
Definition: fvraw.h:52
unsigned int file_id
file id
Definition: fvraw.h:53
colorspace_t colorspace
color space
Definition: fvraw.h:54
unsigned int height
height of image in pixels
Definition: fvraw.h:56
unsigned int width
width of image in pixels
Definition: fvraw.h:55