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 
32 class LossyScaler : public Scaler
33 {
34 public:
35  LossyScaler();
36  virtual ~LossyScaler();
37 
38  virtual void set_scale_factor(float factor);
39  virtual void set_original_dimensions(unsigned int width, unsigned int height);
40  virtual void set_scaled_dimensions(unsigned int width, unsigned int height);
41  virtual void set_original_buffer(unsigned char *buffer);
42  virtual void set_scaled_buffer(unsigned char *buffer);
43  virtual void scale();
44  virtual unsigned int needed_scaled_width();
45  virtual unsigned int needed_scaled_height();
46  virtual float get_scale_factor();
47 
48 private:
49  unsigned int orig_width;
50  unsigned int orig_height;
51  unsigned char *orig_buffer;
52 
53  unsigned int scal_width;
54  unsigned int scal_height;
55  unsigned char *scal_buffer;
56 
57  float scale_factor;
58 };
59 
60 } // end namespace firevision
61 
62 #endif
Lossy image scaler.
Definition: lossy.h:33
virtual ~LossyScaler()
Destructor.
Definition: lossy.cpp:52
virtual void set_scale_factor(float factor)
Set scale factor.
Definition: lossy.cpp:57
virtual void scale()
Scale image.
Definition: lossy.cpp:139
virtual unsigned int needed_scaled_height()
Minimum needed height of scaled image depending on factor and original image height.
Definition: lossy.cpp:127
virtual void set_scaled_dimensions(unsigned int width, unsigned int height)
Set dimenins of scaled image buffer.
Definition: lossy.cpp:83
virtual void set_original_dimensions(unsigned int width, unsigned int height)
Set original image dimensions.
Definition: lossy.cpp:76
LossyScaler()
Constructor.
Definition: lossy.cpp:41
virtual float get_scale_factor()
Returns the scale factor.
Definition: lossy.cpp:133
virtual unsigned int needed_scaled_width()
Minimum needed width of scaled image depending on factor and original image width.
Definition: lossy.cpp:121
virtual void set_original_buffer(unsigned char *buffer)
Set original image buffer.
Definition: lossy.cpp:109
virtual void set_scaled_buffer(unsigned char *buffer)
Set scaled image buffer.
Definition: lossy.cpp:115
Image scaler interface.
Definition: scaler.h:30