Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * lossy.h - lossy scaler, will just through away information, can only 00004 * downscale images! 00005 * 00006 * Generated: Tue May 16 14:57:16 2006 (Automatica 2006) 00007 * Copyright 2005-2006 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __FIREVISION_UTILS_SCALERS_LOSSY_H_ 00026 #define __FIREVISION_UTILS_SCALERS_LOSSY_H_ 00027 00028 #include <fvutils/scalers/scaler.h> 00029 00030 namespace firevision { 00031 #if 0 /* just to make Emacs auto-indent happy */ 00032 } 00033 #endif 00034 00035 class LossyScaler : public Scaler { 00036 00037 public: 00038 LossyScaler(); 00039 virtual ~LossyScaler(); 00040 00041 virtual void set_scale_factor(float factor); 00042 virtual void set_original_dimensions(unsigned int width, 00043 unsigned int height); 00044 virtual void set_scaled_dimensions(unsigned int width, 00045 unsigned int height); 00046 virtual void set_original_buffer(unsigned char *buffer); 00047 virtual void set_scaled_buffer(unsigned char *buffer); 00048 virtual void scale(); 00049 virtual unsigned int needed_scaled_width(); 00050 virtual unsigned int needed_scaled_height(); 00051 virtual float get_scale_factor(); 00052 00053 private: 00054 unsigned int orig_width; 00055 unsigned int orig_height; 00056 unsigned char *orig_buffer; 00057 00058 unsigned int scal_width; 00059 unsigned int scal_height; 00060 unsigned char *scal_buffer; 00061 00062 float scale_factor; 00063 00064 }; 00065 00066 } // end namespace firevision 00067 00068 #endif