"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "rtengine/rawimagesource.h" between
rawtherapee-5.6.tar.xz and rawtherapee-5.7.tar.xz

About: RawTherapee is a powerful cross-platform raw image processing program.

rawimagesource.h  (rawtherapee-5.6.tar.xz):rawimagesource.h  (rawtherapee-5.7.tar.xz)
skipping to change at line 17 skipping to change at line 17
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* RawTherapee is distributed in the hope that it will be useful, * RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef _RAWIMAGESOURCE_ #pragma once
#define _RAWIMAGESOURCE_
#include <array>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include "array2D.h" #include "array2D.h"
#include "color.h" #include "color.h"
#include "curves.h" #include "curves.h"
#include "dcp.h" #include "dcp.h"
#include "iimage.h" #include "iimage.h"
#include "imagesource.h" #include "imagesource.h"
#include "pixelsmap.h"
#define HR_SCALE 2 #define HR_SCALE 2
namespace rtengine namespace rtengine
{ {
class RawImageSource : public ImageSource class RawImageSource : public ImageSource
{ {
private: private:
static DiagonalCurve *phaseOneIccCurve; static DiagonalCurve *phaseOneIccCurve;
static DiagonalCurve *phaseOneIccCurveInv; static DiagonalCurve *phaseOneIccCurveInv;
static LUTf invGrad; // for fast_demosaic static LUTf invGrad; // for fast_demosaic
static LUTf initInvGrad (); static LUTf initInvGrad ();
static void colorSpaceConversion_ (Imagefloat* im, const procparams::ColorMa nagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedde d, cmsHPROFILE camprofile, double cam[3][3], const std::string &camName); static void colorSpaceConversion_ (Imagefloat* im, const procparams::ColorMa nagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedde d, cmsHPROFILE camprofile, double cam[3][3], const std::string &camName);
int defTransform (int tran); int defTransform (int tran);
protected: protected:
MyMutex getImageMutex; // locks getImage MyMutex getImageMutex; // locks getImage
skipping to change at line 77 skipping to change at line 77
bool d1x; bool d1x;
int border; int border;
float chmax[4], hlmax[4], clmax[4]; float chmax[4], hlmax[4], clmax[4];
double initialGain; // initial gain calculated after scale_colors double initialGain; // initial gain calculated after scale_colors
double camInitialGain; double camInitialGain;
double defGain; double defGain;
cmsHPROFILE camProfile; cmsHPROFILE camProfile;
bool rgbSourceModified; bool rgbSourceModified;
RawImage* ri; // Copy of raw pixels, NOT corrected for initial gain, blackp oint etc. RawImage* ri; // Copy of raw pixels, NOT corrected for initial gain, blackp oint etc.
RawImage* riFrames[4] = {nullptr}; RawImage* riFrames[6] = {nullptr};
unsigned int currFrame = 0; unsigned int currFrame = 0;
unsigned int numFrames = 0; unsigned int numFrames = 0;
int flatFieldAutoClipValue = 0; int flatFieldAutoClipValue = 0;
array2D<float> rawData; // holds preprocessed pixel values, rowData[i][j] c orresponds to the ith row and jth column array2D<float> rawData; // holds preprocessed pixel values, rowData[i][j] c orresponds to the ith row and jth column
array2D<float> *rawDataFrames[4] = {nullptr}; array2D<float> *rawDataFrames[6] = {nullptr};
array2D<float> *rawDataBuffer[3] = {nullptr}; array2D<float> *rawDataBuffer[5] = {nullptr};
// the interpolated green plane: // the interpolated green plane:
array2D<float> green; array2D<float> green;
// the interpolated red plane: // the interpolated red plane:
array2D<float> red; array2D<float> red;
// the interpolated blue plane: // the interpolated blue plane:
array2D<float> blue; array2D<float> blue;
bool rawDirty; bool rawDirty;
float psRedBrightness[4]; float psRedBrightness[4];
float psGreenBrightness[4]; float psGreenBrightness[4];
float psBlueBrightness[4]; float psBlueBrightness[4];
std::vector<double> histMatchingCache; std::vector<double> histMatchingCache;
const std::unique_ptr<procparams::ColorManagementParams> histMatchingParams; const std::unique_ptr<procparams::ColorManagementParams> histMatchingParams;
void processFalseColorCorrectionThread (Imagefloat* im, array2D<float> &rbco nv_Y, array2D<float> &rbconv_I, array2D<float> &rbconv_Q, array2D<float> &rbout_ I, array2D<float> &rbout_Q, const int row_from, const int row_to); void processFalseColorCorrectionThread (Imagefloat* im, array2D<float> &rbco nv_Y, array2D<float> &rbconv_I, array2D<float> &rbconv_Q, array2D<float> &rbout_ I, array2D<float> &rbout_Q, const int row_from, const int row_to);
void hlRecovery (const std::string &method, float* red, float* gree n, float* blue, int width, float* hlmax); void hlRecovery (const std::string &method, float* red, float* gree n, float* blue, int width, float* hlmax);
void transformRect (const PreviewProps &pp, int tran, int &sx1, int &s y1, int &width, int &height, int &fw); void transformRect (const PreviewProps &pp, int tran, int &sx1, int &s y1, int &width, int &height, int &fw);
void transformPosition (int x, int y, int tran, int& tx, int& ty); void transformPosition (int x, int y, int tran, int& tx, int& ty);
unsigned FC(int row, int col) unsigned FC(int row, int col) const
{ {
return ri->FC(row, col); return ri->FC(row, col);
} }
inline void getRowStartEnd (int x, int &start, int &end); inline void getRowStartEnd (int x, int &start, int &end);
static void getProfilePreprocParams(cmsHPROFILE in, float& gammafac, float& lineFac, float& lineSum); static void getProfilePreprocParams(cmsHPROFILE in, float& gammafac, float& lineFac, float& lineSum);
public: public:
RawImageSource (); RawImageSource ();
~RawImageSource () override; ~RawImageSource () override;
int load(const Glib::ustring &fname) override { return load(fname, false); } int load(const Glib::ustring &fname) override { return load(fname, false); }
int load(const Glib::ustring &fname, bool firstFrameOnly); int load(const Glib::ustring &fname, bool firstFrameOnly);
void preprocess (const procparams::RAWParams &raw, const procparams: :LensProfParams &lensProf, const procparams::CoarseTransformParams& coarse, bool prepareDenoise = true) override; void preprocess (const procparams::RAWParams &raw, const procparams: :LensProfParams &lensProf, const procparams::CoarseTransformParams& coarse, bool prepareDenoise = true) override;
void filmNegativeProcess (const procparams::FilmNegativeParams &param
s) override;
bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran
, const FilmNegativeParams &currentParams, std::array<float, 3>& newExps) overri
de;
void demosaic (const procparams::RAWParams &raw, bool autoContrast , double &contrastThreshold) override; void demosaic (const procparams::RAWParams &raw, bool autoContrast , double &contrastThreshold) override;
void retinex (const procparams::ColorManagementParams& cmp, con st procparams::RetinexParams &deh, const procparams::ToneCurveParams& Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurv e, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D <float, 4> &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useH sl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &T sigma, float &Tmin, float &Tmax, LUTu &histLRETI) override; void retinex (const procparams::ColorManagementParams& cmp, con st procparams::RetinexParams &deh, const procparams::ToneCurveParams& Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurv e, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D <float, 4> &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useH sl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &T sigma, float &Tmin, float &Tmax, LUTu &histLRETI) override;
void retinexPrepareCurves (const procparams::RetinexParams &ret inexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextran smissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) override; void retinexPrepareCurves (const procparams::RetinexParams &ret inexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextran smissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) override;
void retinexPrepareBuffers (const procparams::ColorManagementPar ams& cmp, const procparams::RetinexParams &retinexParams, multi_array2D<float, 4 > &conversionBuffer, LUTu &lhist16RETI) override; void retinexPrepareBuffers (const procparams::ColorManagementPar ams& cmp, const procparams::RetinexParams &retinexParams, multi_array2D<float, 4 > &conversionBuffer, LUTu &lhist16RETI) override;
void flushRawData () override; void flushRawData () override;
void flushRGB () override; void flushRGB () override;
void HLRecovery_Global (const procparams::ToneCurveParams &hrp) overr ide; void HLRecovery_Global (const procparams::ToneCurveParams &hrp) overr ide;
void refinement_lassus (int PassCount); void refinement_lassus (int PassCount);
void refinement(int PassCount); void refinement(int PassCount);
void setBorder(unsigned int rawBorder) override {border = rawBorder;} void setBorder(unsigned int rawBorder) override {border = rawBorder;}
skipping to change at line 196 skipping to change at line 198
DCPProfile *getDCP(const procparams::ColorManagementParams &cmp, DCPProfile: :ApplyState &as) override; DCPProfile *getDCP(const procparams::ColorManagementParams &cmp, DCPProfile: :ApplyState &as) override;
void convertColorSpace(Imagefloat* image, const procparams::ColorManagementP arams &cmp, const ColorTemp &wb) override; void convertColorSpace(Imagefloat* image, const procparams::ColorManagementP arams &cmp, const ColorTemp &wb) override;
static bool findInputProfile(Glib::ustring inProfile, cmsHPROFILE embedded, std::string camName, DCPProfile **dcpProf, cmsHPROFILE& in); static bool findInputProfile(Glib::ustring inProfile, cmsHPROFILE embedded, std::string camName, DCPProfile **dcpProf, cmsHPROFILE& in);
static void colorSpaceConversion (Imagefloat* im, const ColorManagementPar ams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROF ILE camprofile, double cam[3][3], const std::string &camName) static void colorSpaceConversion (Imagefloat* im, const ColorManagementPar ams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROF ILE camprofile, double cam[3][3], const std::string &camName)
{ {
colorSpaceConversion_ (im, cmp, wb, pre_mul, embedded, camprofile, cam, camName); colorSpaceConversion_ (im, cmp, wb, pre_mul, embedded, camprofile, cam, camName);
} }
static void inverse33 (const double (*coeff)[3], double (*icoeff)[3]); static void inverse33 (const double (*coeff)[3], double (*icoeff)[3]);
void boxblur2(float** src, float** dst, float** temp, int H, int W, int box
);
void boxblur_resamp(float **src, float **dst, float** temp, int H, int W, in
t box, int samp );
void MSR(float** luminance, float **originalLuminance, float **exLuminance, LUTf & mapcurve, bool &mapcontlutili, int width, int height, const RetinexParam s &deh, const RetinextransmissionCurve & dehatransmissionCurve, const Retinexgai ntransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, floa t &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); void MSR(float** luminance, float **originalLuminance, float **exLuminance, LUTf & mapcurve, bool &mapcontlutili, int width, int height, const RetinexParam s &deh, const RetinextransmissionCurve & dehatransmissionCurve, const Retinexgai ntransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, floa t &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax);
void HLRecovery_inpaint (float** red, float** green, float** blue) override; void HLRecovery_inpaint (float** red, float** green, float** blue) override;
static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval); static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval);
static void HLRecovery_CIELab (float* rin, float* gin, float* bin, float* ro ut, float* gout, float* bout, int width, float maxval, double cam[3][3], double icam[3][3]); static void HLRecovery_CIELab (float* rin, float* gin, float* bin, float* ro ut, float* gout, float* bout, int width, float maxval, double cam[3][3], double icam[3][3]);
static void HLRecovery_blend (float* rin, float* gin, float* bin, int width, float maxval, float* hlmax); static void HLRecovery_blend (float* rin, float* gin, float* bin, int width, float maxval, float* hlmax);
static void init (); static void init ();
static void cleanup (); static void cleanup ();
void setCurrentFrame(unsigned int frameNum) override { void setCurrentFrame(unsigned int frameNum) override {
if (numFrames == 2 && frameNum == 2) { // special case for averaging of two frames if (numFrames == 2 && frameNum == 2) { // special case for averaging of two frames
currFrame = frameNum; currFrame = frameNum;
skipping to change at line 260 skipping to change at line 260
double* fitParamsTransfer, double* fitParamsTransfer,
bool fitParamsIn, bool fitParamsIn,
bool fitParamsOut, bool fitParamsOut,
float* buffer, float* buffer,
bool freeBuffer, bool freeBuffer,
size_t chunkSize = 1, size_t chunkSize = 1,
bool measure = false bool measure = false
); );
void ddct8x8s(int isgn, float a[8][8]); void ddct8x8s(int isgn, float a[8][8]);
int interpolateBadPixelsBayer( PixelsMap &bitmapBads, array2D<float> &rawDa int interpolateBadPixelsBayer(const PixelsMap &bitmapBads, array2D<float> &r
ta ); awData);
int interpolateBadPixelsNColours( PixelsMap &bitmapBads, const int colours int interpolateBadPixelsNColours(const PixelsMap &bitmapBads, int colours);
); int interpolateBadPixelsXtrans(const PixelsMap &bitmapBads);
int interpolateBadPixelsXtrans( PixelsMap &bitmapBads ); int findHotDeadPixels(PixelsMap &bpMap, float thresh, bool findHotPixels, bo
int findHotDeadPixels( PixelsMap &bpMap, float thresh, bool findHotPixels, ol findDeadPixels) const;
bool findDeadPixels ); int findZeroPixels(PixelsMap &bpMap) const;
void cfa_linedn (float linenoiselevel, bool horizontal, bool vertical, const CFALineDenoiseRowBlender &rowblender);//Emil's line denoise void cfa_linedn (float linenoiselevel, bool horizontal, bool vertical, const CFALineDenoiseRowBlender &rowblender);//Emil's line denoise
void green_equilibrate_global (array2D<float> &rawData); void green_equilibrate_global (array2D<float> &rawData);
void green_equilibrate (const GreenEqulibrateThreshold &greenthresh, array2D <float> &rawData);//Emil's green equilibration void green_equilibrate (const GreenEqulibrateThreshold &greenthresh, array2D <float> &rawData);//Emil's green equilibration
void nodemosaic(bool bw); void nodemosaic(bool bw);
void eahd_demosaic(); void eahd_demosaic();
void hphd_demosaic(); void hphd_demosaic();
void vng4_demosaic(const array2D<float> &rawData, array2D<float> &red, array 2D<float> &green, array2D<float> &blue); void vng4_demosaic(const array2D<float> &rawData, array2D<float> &red, array 2D<float> &green, array2D<float> &blue);
void ppg_demosaic(); void ppg_demosaic();
skipping to change at line 310 skipping to change at line 310
void cielab (const float (*rgb)[3], float* l, float* a, float *b, const int width, const int height, const int labWidth, const float xyz_cam[3][3]); void cielab (const float (*rgb)[3], float* l, float* a, float *b, const int width, const int height, const int labWidth, const float xyz_cam[3][3]);
void xtransborder_interpolate (int border, array2D<float> &red, array2D<floa t> &green, array2D<float> &blue); void xtransborder_interpolate (int border, array2D<float> &red, array2D<floa t> &green, array2D<float> &blue);
void xtrans_interpolate (const int passes, const bool useCieLab, size_t chun kSize = 1, bool measure = false); void xtrans_interpolate (const int passes, const bool useCieLab, size_t chun kSize = 1, bool measure = false);
void fast_xtrans_interpolate (const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue); void fast_xtrans_interpolate (const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue);
void pixelshift(int winx, int winy, int winw, int winh, const RAWParams &raw Params, unsigned int frame, const std::string &make, const std::string &model, f loat rawWpCorrection); void pixelshift(int winx, int winy, int winw, int winh, const RAWParams &raw Params, unsigned int frame, const std::string &make, const std::string &model, f loat rawWpCorrection);
void hflip (Imagefloat* im); void hflip (Imagefloat* im);
void vflip (Imagefloat* im); void vflip (Imagefloat* im);
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) override ; void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) override ;
}; };
} }
#endif
 End of changes. 13 change blocks. 
20 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)