~ubuntu-branches/ubuntu/vivid/rawstudio/vivid

« back to all changes in this revision

Viewing changes to plugins/denoise/floatplanarimage.h

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2011-07-28 17:36:32 UTC
  • mfrom: (2.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110728173632-5czluz9ye3c83zc5
Tags: 2.0-1
* [3750b2cf] Merge commit 'upstream/2.0'
* [63637468] Removing Patch, not necessary anymore.
* [2fb580dc] Add new build-dependencies.
* [c57d953b] Run dh_autoreconf due to patches in configure.in
* [13febe39] Add patch to remove the libssl requirement.
* [5ae773fe] Replace libjpeg62-dev by libjpeg8-dev :)
* [1969d755] Don't build static libraries.
* [7cfe0a2e] Add a patch to fix the plugin directory path.
  As plugins are shared libraries, they need to go into /usr/lib,
  not into /usr/share.
  Thanks to Andrew McMillan
* [c1d0d9dd] Don't install .la files for all plugins and libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>, 
 
3
 * * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef floatplanarimage_h__
 
21
#define floatplanarimage_h__
 
22
#include "floatimageplane.h"
 
23
#include "jobqueue.h"
 
24
#include "fftwindow.h"
 
25
 
 
26
namespace RawStudio {
 
27
namespace FFTFilter {
 
28
 
 
29
// A container and utility class
 
30
 
 
31
#define WB_R_CORR 2.4150f
 
32
#define WB_B_CORR 1.4140f
 
33
 
 
34
 
 
35
class FloatPlanarImage
 
36
{
 
37
public:
 
38
  FloatPlanarImage(void);
 
39
  FloatPlanarImage( const FloatPlanarImage &img );  // Creates image with similar features
 
40
 
 
41
  virtual ~FloatPlanarImage(void);
 
42
  void allocate_planes();
 
43
  void mirrorEdges();  
 
44
  FloatImagePlane **p;
 
45
  int nPlanes;
 
46
  void unpackInterleaved(const RS_IMAGE16* image);
 
47
  void packInterleaved( RS_IMAGE16* image );
 
48
  void setFilter( int plane, ComplexFilter *f, FFTWindow *window);
 
49
  JobQueue* getJobs(FloatPlanarImage &outImg);
 
50
  void unpackInterleavedYUV( const ImgConvertJob* j );
 
51
#if defined (__i386__) || defined (__x86_64__) 
 
52
  void packInterleavedYUV_SSE2( const ImgConvertJob* j);
 
53
#endif
 
54
#if defined (__x86_64__)
 
55
  void unpackInterleavedYUV_SSE2( const ImgConvertJob* j );
 
56
//  void packInterleavedYUV_SSE4( const ImgConvertJob* j);
 
57
#endif
 
58
  void packInterleavedYUV( const ImgConvertJob* j);
 
59
  JobQueue* getUnpackInterleavedYUVJobs(RS_IMAGE16* image);
 
60
  JobQueue* getPackInterleavedYUVJobs(RS_IMAGE16* image);
 
61
  FloatImagePlane* getPlaneSliceFrom(int plane, int x, int y);
 
62
 
 
63
  int bw;  // Block width
 
64
  int bh;  // Block height
 
65
  int ox;  // Overlap pixels
 
66
  int oy;  // Overlap pixels
 
67
 
 
68
  float redCorrection;
 
69
  float blueCorrection;
 
70
 
 
71
  static void initConvTable();
 
72
  static float shortToFloat[65536*4];
 
73
};
 
74
 
 
75
}} // namespace RawStudio::FFTFilter
 
76
 
 
77
#endif // floatplanarimage_h__
 
78
 
 
79
inline guint clampbits(gint x, guint n) { guint32 _y_temp; if( (_y_temp=x>>n) ) x = ~_y_temp >> (32-n); return x;}