lossy.h

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 class LossyScaler : public Scaler {
00031
00032  public:
00033   LossyScaler();
00034   virtual ~LossyScaler();
00035
00036   virtual void             set_scale_factor(float factor);
00037   virtual void             set_original_dimensions(unsigned int width,
00038                                                    unsigned int height);
00039   virtual void             set_scaled_dimensions(unsigned int width,
00040                                                  unsigned int height);
00041   virtual void             set_original_buffer(unsigned char *buffer);
00042   virtual void             set_scaled_buffer(unsigned char *buffer);
00043   virtual void             scale();
00044   virtual unsigned int     needed_scaled_width();
00045   virtual unsigned int     needed_scaled_height();
00046   virtual float            get_scale_factor();
00047
00048  private:
00049   unsigned int    orig_width;
00050   unsigned int    orig_height;
00051   unsigned char  *orig_buffer;
00052
00053   unsigned int    scal_width;
00054   unsigned int    scal_height;
00055   unsigned char  *scal_buffer;
00056
00057   float           scale_factor;
00058
00059 };
00060
00061 #endif