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 /** @class ImageDecompressor <fvutils/compression/imagedecompressor.h> 00027 * Image de-compressor interface. 00028 * Currently only decompressing from memory to memory is supported. 00029 * @author Tim Niemueller 00030 * 00031 * @fn void ImageDecompressor::decompress() 00032 * Decompress image. 00033 */ 00034 00035 /** @var int ImageDecompressor::_width 00036 * Width of image in pixels 00037 */ 00038 00039 /** @var int ImageDecompressor::_height 00040 * Height of image in pixels 00041 */ 00042 00043 /** @var int ImageDecompressor::_compressed_buffer 00044 * Buffer containing the compressed image 00045 */ 00046 00047 /** @var int ImageDecompressor::_compressed_buffer_size 00048 * Size in bytes of _compressed_buffer 00049 */ 00050 00051 /** @var int ImageDecompressor::_decompressed_buffer 00052 * Buffer containing the decompressed image after decompression 00053 */ 00054 00055 /** @var int ImageDecompressor::_decompressed_buffer_size 00056 * Size in bytes of _decompressed_buffer 00057 */ 00058 00059 00060 /** Virtual empty destructor. */ 00061 ImageDecompressor::~ImageDecompressor() 00062 { 00063 } 00064 00065 00066 /** Set image dimensions. 00067 * @param width width of image in pixels 00068 * @param height height of image in pixels 00069 */ 00070 void 00071 ImageDecompressor::set_image_dimensions(unsigned int width, unsigned int height) 00072 { 00073 _width = width; 00074 _height = height; 00075 } 00076 00077 00078 /** Set compressed buffer. 00079 * @param buf buffer 00080 * @param buf_size size of buffer in bytes 00081 */ 00082 void 00083 ImageDecompressor::set_compressed_buffer(unsigned char *buf, unsigned int buf_size) 00084 { 00085 _compressed_buffer = buf; 00086 _compressed_buffer_size = buf_size; 00087 } 00088 00089 00090 /** Set decompressed buffer. 00091 * @param buf decompressed buffer 00092 * @param buf_size buffer size 00093 */ 00094 void 00095 ImageDecompressor::set_decompressed_buffer(unsigned char *buf, unsigned int buf_size) 00096 { 00097 _decompressed_buffer = buf; 00098 _decompressed_buffer_size = buf_size; 00099 }

