Fawkes API  Fawkes Development Version
imagedecompressor.cpp
1 
2 /***************************************************************************
3  * imagedecompressor.cpp - image de-compressor interface
4  *
5  * Created: Tue Nov 13 10:54:03 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 #include <fvutils/compression/imagedecompressor.h>
25 
26 
27 namespace firevision {
28 #if 0 /* just to make Emacs auto-indent happy */
29 }
30 #endif
31 
32 /** @class ImageDecompressor <fvutils/compression/imagedecompressor.h>
33  * Image de-compressor interface.
34  * Currently only decompressing from memory to memory is supported.
35  * @author Tim Niemueller
36  *
37  * @fn void ImageDecompressor::decompress()
38  * Decompress image.
39  */
40 
41 /** @var int ImageDecompressor::_width
42  * Width of image in pixels
43  */
44 
45 /** @var int ImageDecompressor::_height
46  * Height of image in pixels
47  */
48 
49 /** @var int ImageDecompressor::_compressed_buffer
50  * Buffer containing the compressed image
51  */
52 
53 /** @var int ImageDecompressor::_compressed_buffer_size
54  * Size in bytes of _compressed_buffer
55  */
56 
57 /** @var int ImageDecompressor::_decompressed_buffer
58  * Buffer containing the decompressed image after decompression
59  */
60 
61 /** @var int ImageDecompressor::_decompressed_buffer_size
62  * Size in bytes of _decompressed_buffer
63  */
64 
65 
66 /** Virtual empty destructor. */
68 {
69 }
70 
71 
72 /** Set image dimensions.
73  * @param width width of image in pixels
74  * @param height height of image in pixels
75  */
76 void
77 ImageDecompressor::set_image_dimensions(unsigned int width, unsigned int height)
78 {
79  _width = width;
80  _height = height;
81 }
82 
83 
84 /** Set compressed buffer.
85  * @param buf buffer
86  * @param buf_size size of buffer in bytes
87  */
88 void
89 ImageDecompressor::set_compressed_buffer(unsigned char *buf, unsigned int buf_size)
90 {
91  _compressed_buffer = buf;
92  _compressed_buffer_size = buf_size;
93 }
94 
95 
96 /** Set decompressed buffer.
97  * @param buf decompressed buffer
98  * @param buf_size buffer size
99  */
100 void
101 ImageDecompressor::set_decompressed_buffer(unsigned char *buf, unsigned int buf_size)
102 {
103  _decompressed_buffer = buf;
104  _decompressed_buffer_size = buf_size;
105 }
106 
107 } // end namespace firevision
virtual ~ImageDecompressor()
Virtual empty destructor.
virtual void set_compressed_buffer(unsigned char *buf, unsigned int buf_size)
Set compressed buffer.
unsigned char * _decompressed_buffer
Buffer containing the decompressed image after decompression.
virtual void set_decompressed_buffer(unsigned char *buf, unsigned int buf_size)
Set decompressed buffer.
unsigned int _compressed_buffer_size
Size in bytes of _compressed_buffer.
unsigned int _height
Height of image in pixels.
unsigned char * _compressed_buffer
Buffer containing the compressed image.
virtual void set_image_dimensions(unsigned int width, unsigned int height)
Set image dimensions.
unsigned int _decompressed_buffer_size
Size in bytes of _decompressed_buffer.
unsigned int _width
Width of image in pixels.