Fawkes API  Fawkes Development Version
imagedecompressor.h
1 
2 /***************************************************************************
3  * imagedecompressor.h - image de-compressor interface
4  *
5  * Created: Tue Nov 13 10:50:12 2007
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_UTILS_COMPRESSION_IMAGEDECOMPRESSOR_H_
25 #define _FIREVISION_UTILS_COMPRESSION_IMAGEDECOMPRESSOR_H_
26 
27 #include <fvutils/color/colorspaces.h>
28 #include <sys/types.h>
29 
30 namespace firevision {
31 
32 class ImageDecompressor
33 {
34 public:
35  /* Maybe later...
36  * Where to get the compressed image from
37  enum DecompressionSource {
38  COMP_SRC_FILE, < read compressed image from file
39  COMP_SRC_MEM < read compressed image from buffer in memory
40  };
41  */
42 
43  virtual ~ImageDecompressor();
44 
45  virtual void set_image_dimensions(unsigned int width, unsigned int height);
46  virtual void set_compressed_buffer(unsigned char *buf, unsigned int buf_size);
47  virtual void set_decompressed_buffer(unsigned char *buf, unsigned int buf_size);
48  virtual void decompress() = 0;
49 
50 protected:
51  unsigned int _width;
52  unsigned int _height;
53  unsigned char *_compressed_buffer;
54  unsigned char *_decompressed_buffer;
55  unsigned int _compressed_buffer_size;
56  unsigned int _decompressed_buffer_size;
57 };
58 
59 } // end namespace firevision
60 
61 #endif
firevision::ImageDecompressor::set_decompressed_buffer
virtual void set_decompressed_buffer(unsigned char *buf, unsigned int buf_size)
Set decompressed buffer.
Definition: imagedecompressor.cpp:97
firevision::ImageDecompressor::~ImageDecompressor
virtual ~ImageDecompressor()
Virtual empty destructor.
Definition: imagedecompressor.cpp:66
firevision::ImageDecompressor::_height
unsigned int _height
Definition: imagedecompressor.h:61
firevision::ImageDecompressor::decompress
virtual void decompress()=0
firevision::ImageDecompressor::_decompressed_buffer
unsigned char * _decompressed_buffer
Definition: imagedecompressor.h:63
firevision::ImageDecompressor::_width
unsigned int _width
Definition: imagedecompressor.h:60
firevision::ImageDecompressor::set_image_dimensions
virtual void set_image_dimensions(unsigned int width, unsigned int height)
Set image dimensions.
Definition: imagedecompressor.cpp:75
firevision::ImageDecompressor::set_compressed_buffer
virtual void set_compressed_buffer(unsigned char *buf, unsigned int buf_size)
Set compressed buffer.
Definition: imagedecompressor.cpp:86
firevision::ImageDecompressor::_compressed_buffer_size
unsigned int _compressed_buffer_size
Definition: imagedecompressor.h:64
firevision::ImageDecompressor::_decompressed_buffer_size
unsigned int _decompressed_buffer_size
Definition: imagedecompressor.h:65
firevision::ImageDecompressor::_compressed_buffer
unsigned char * _compressed_buffer
Definition: imagedecompressor.h:62