Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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