Fawkes API  Fawkes Development Version
imagedecompressor.cpp
00001 
00002 /***************************************************************************
00003  *  imagedecompressor.cpp - image de-compressor interface
00004  *
00005  *  Created: Tue Nov 13 10:54:03 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <fvutils/compression/imagedecompressor.h>
00025 
00026 
00027 namespace firevision {
00028 #if 0 /* just to make Emacs auto-indent happy */
00029 }
00030 #endif
00031 
00032 /** @class ImageDecompressor <fvutils/compression/imagedecompressor.h>
00033  * Image de-compressor interface.
00034  * Currently only decompressing from memory to memory is supported.
00035  * @author Tim Niemueller
00036  *
00037  * @fn void ImageDecompressor::decompress()
00038  * Decompress image.
00039  */
00040 
00041 /** @var int ImageDecompressor::_width
00042  * Width of image in pixels
00043  */
00044 
00045 /** @var int ImageDecompressor::_height
00046  * Height of image in pixels
00047  */
00048 
00049 /** @var int ImageDecompressor::_compressed_buffer
00050  * Buffer containing the compressed image
00051  */
00052 
00053 /** @var int ImageDecompressor::_compressed_buffer_size
00054  * Size in bytes of _compressed_buffer
00055  */
00056 
00057 /** @var int ImageDecompressor::_decompressed_buffer
00058  * Buffer containing the decompressed image after decompression
00059  */
00060 
00061 /** @var int ImageDecompressor::_decompressed_buffer_size
00062  * Size in bytes of _decompressed_buffer
00063  */
00064 
00065 
00066 /** Virtual empty destructor. */
00067 ImageDecompressor::~ImageDecompressor()
00068 {
00069 }
00070 
00071 
00072 /** Set image dimensions.
00073  * @param width width of image in pixels
00074  * @param height height of image in pixels
00075  */
00076 void
00077 ImageDecompressor::set_image_dimensions(unsigned int width, unsigned int height)
00078 {
00079   _width  = width;
00080   _height = height;
00081 }
00082 
00083 
00084 /** Set compressed buffer.
00085  * @param buf buffer
00086  * @param buf_size size of buffer in bytes
00087  */
00088 void
00089 ImageDecompressor::set_compressed_buffer(unsigned char *buf, unsigned int buf_size)
00090 {
00091   _compressed_buffer = buf;
00092   _compressed_buffer_size = buf_size;
00093 }
00094 
00095 
00096 /** Set decompressed buffer.
00097  * @param buf decompressed buffer
00098  * @param buf_size buffer size
00099  */
00100 void
00101 ImageDecompressor::set_decompressed_buffer(unsigned char *buf, unsigned int buf_size)
00102 {
00103   _decompressed_buffer = buf;
00104   _decompressed_buffer_size = buf_size;
00105 }
00106 
00107 } // end namespace firevision