2
* * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>,
3
* * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
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.
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.
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.
20
#ifndef floatplanarimage_h__
21
#define floatplanarimage_h__
22
#include "floatimageplane.h"
24
#include "fftwindow.h"
29
// A container and utility class
31
#define WB_R_CORR 2.4150f
32
#define WB_B_CORR 1.4140f
35
class FloatPlanarImage
38
FloatPlanarImage(void);
39
FloatPlanarImage( const FloatPlanarImage &img ); // Creates image with similar features
41
virtual ~FloatPlanarImage(void);
42
void allocate_planes();
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);
54
#if defined (__x86_64__)
55
void unpackInterleavedYUV_SSE2( const ImgConvertJob* j );
56
// void packInterleavedYUV_SSE4( const ImgConvertJob* j);
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);
63
int bw; // Block width
64
int bh; // Block height
65
int ox; // Overlap pixels
66
int oy; // Overlap pixels
71
static void initConvTable();
72
static float shortToFloat[65536*4];
75
}} // namespace RawStudio::FFTFilter
77
#endif // floatplanarimage_h__
79
inline guint clampbits(gint x, guint n) { guint32 _y_temp; if( (_y_temp=x>>n) ) x = ~_y_temp >> (32-n); return x;}