Fawkes API  Fawkes Development Version
lossy.h
1 
2 /***************************************************************************
3  * lossy.h - lossy scaler, will just through away information, can only
4  * downscale images!
5  *
6  * Generated: Tue May 16 14:57:16 2006 (Automatica 2006)
7  * Copyright 2005-2006 Tim Niemueller [www.niemueller.de]
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef __FIREVISION_UTILS_SCALERS_LOSSY_H_
26 #define __FIREVISION_UTILS_SCALERS_LOSSY_H_
27 
28 #include <fvutils/scalers/scaler.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
35 class LossyScaler : public Scaler {
36 
37  public:
38  LossyScaler();
39  virtual ~LossyScaler();
40 
41  virtual void set_scale_factor(float factor);
42  virtual void set_original_dimensions(unsigned int width,
43  unsigned int height);
44  virtual void set_scaled_dimensions(unsigned int width,
45  unsigned int height);
46  virtual void set_original_buffer(unsigned char *buffer);
47  virtual void set_scaled_buffer(unsigned char *buffer);
48  virtual void scale();
49  virtual unsigned int needed_scaled_width();
50  virtual unsigned int needed_scaled_height();
51  virtual float get_scale_factor();
52 
53  private:
54  unsigned int orig_width;
55  unsigned int orig_height;
56  unsigned char *orig_buffer;
57 
58  unsigned int scal_width;
59  unsigned int scal_height;
60  unsigned char *scal_buffer;
61 
62  float scale_factor;
63 
64 };
65 
66 } // end namespace firevision
67 
68 #endif
virtual float get_scale_factor()
Returns the scale factor.
Definition: lossy.cpp:147
virtual unsigned int needed_scaled_height()
Minimum needed height of scaled image depending on factor and original image height.
Definition: lossy.cpp:140
virtual void set_scaled_buffer(unsigned char *buffer)
Set scaled image buffer.
Definition: lossy.cpp:126
virtual void set_original_buffer(unsigned char *buffer)
Set original image buffer.
Definition: lossy.cpp:119
virtual ~LossyScaler()
Destructor.
Definition: lossy.cpp:57
Lossy image scaler.
Definition: lossy.h:35
Image scaler interface.
Definition: scaler.h:32
virtual void set_original_dimensions(unsigned int width, unsigned int height)
Set original image dimensions.
Definition: lossy.cpp:83
virtual void set_scaled_dimensions(unsigned int width, unsigned int height)
Set dimenins of scaled image buffer.
Definition: lossy.cpp:92
LossyScaler()
Constructor.
Definition: lossy.cpp:45
virtual void set_scale_factor(float factor)
Set scale factor.
Definition: lossy.cpp:63
virtual unsigned int needed_scaled_width()
Minimum needed width of scaled image depending on factor and original image width.
Definition: lossy.cpp:133
virtual void scale()
Scale image.
Definition: lossy.cpp:153