Formatted all .cc and .h code in rtengine, rtexif and rtgui using astyle

This commit is contained in:
DrSlony
2015-08-11 11:55:03 +02:00
parent effb46c3e1
commit 0e0cfb9b25
452 changed files with 133354 additions and 99460 deletions

View File

@@ -7,7 +7,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -28,130 +28,133 @@
#include "imagefloat.h"
#include "../rtgui/threadutils.h"
namespace rtengine {
namespace rtengine
{
class Thumbnail {
class Thumbnail
{
MyMutex thumbMutex;
MyMutex thumbMutex;
cmsHPROFILE camProfile;
double iColorMatrix[3][3];
double cam2xyz[3][3];
cmsHPROFILE camProfile;
double iColorMatrix[3][3];
double cam2xyz[3][3];
void transformPixel (int x, int y, int tran, int& tx, int& ty);
void transformPixel (int x, int y, int tran, int& tx, int& ty);
static unsigned short *igammatab;
static unsigned char *gammatab;
static unsigned short *igammatab;
static unsigned char *gammatab;
ImageIO* thumbImg;
double camwbRed;
double camwbGreen;
double camwbBlue;
double redAWBMul, greenAWBMul, blueAWBMul; // multipliers for auto WB
double autoWBTemp, autoWBGreen, wbEqual; // autoWBTemp and autoWBGreen are updated each time autoWB is requested and if wbEqual has been modified
LUTu aeHistogram;
int aeHistCompression;
int embProfileLength;
unsigned char* embProfileData;
cmsHPROFILE embProfile;
double redMultiplier;
double greenMultiplier;
double blueMultiplier;
double scale;
double defGain;
int scaleForSave;
bool gammaCorrected;
double colorMatrix[3][3];
ImageIO* thumbImg;
double camwbRed;
double camwbGreen;
double camwbBlue;
double redAWBMul, greenAWBMul, blueAWBMul; // multipliers for auto WB
double autoWBTemp, autoWBGreen, wbEqual; // autoWBTemp and autoWBGreen are updated each time autoWB is requested and if wbEqual has been modified
LUTu aeHistogram;
int aeHistCompression;
int embProfileLength;
unsigned char* embProfileData;
cmsHPROFILE embProfile;
double redMultiplier;
double greenMultiplier;
double blueMultiplier;
double scale;
double defGain;
int scaleForSave;
bool gammaCorrected;
double colorMatrix[3][3];
public:
public:
bool isRaw;
~Thumbnail ();
Thumbnail ();
static void initGamma ();
static void cleanupGamma ();
void init ();
IImage8* processImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, std::string camName,
double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& scale);
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, double& scale);
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
void getDimensions (int& w, int& h, double& scaleFac);
static Thumbnail* loadQuickFromRaw (const Glib::ustring& fname, rtengine::RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate, bool inspectorMode=false);
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, double wbEq, bool rotate);
static Thumbnail* loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode=false);
static RawMetaDataLocation loadMetaDataFromRaw (const Glib::ustring& fname);
void getCamWB (double& temp, double& green);
void getAutoWB (double& temp, double& green, double equal);
void getAutoWBMultipliers (double& rm, double& gm, double& bm);
void getSpotWB (const procparams::ProcParams& params, int x, int y, int rect, double& temp, double& green);
void applyAutoExp (procparams::ProcParams& pparams);
unsigned char* getGrayscaleHistEQ (int trim_width);
bool writeImage (const Glib::ustring& fname, int format);
bool readImage (const Glib::ustring& fname);
bool readData (const Glib::ustring& fname);
bool writeData (const Glib::ustring& fname);
bool readEmbProfile (const Glib::ustring& fname);
bool writeEmbProfile (const Glib::ustring& fname);
bool isRaw;
bool readAEHistogram (const Glib::ustring& fname);
bool writeAEHistogram (const Glib::ustring& fname);
~Thumbnail ();
Thumbnail ();
unsigned char* getImage8Data(); // accessor to the 8bit image if it is one, which should be the case for the "Inspector" mode.
static void initGamma ();
static void cleanupGamma ();
void init ();
// Hombre: ... let's hope that proper template can make this cleaner
IImage8* processImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, std::string camName,
double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& scale);
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp, double& scale);
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
void getDimensions (int& w, int& h, double& scaleFac);
static ImageIO* resizeToSameType(int nw, int nh, TypeInterpolation interp, ImageIO* srcImg) {
ImageIO* imgPtr;
if (srcImg->getType() == sImage8) {
Image8* castedSrcImg = static_cast<Image8*>(srcImg);
Image8* img8 = new Image8 (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, img8);
imgPtr = img8;
}
else if (srcImg->getType() == sImage16) {
Image16* castedSrcImg = static_cast<Image16*>(srcImg);
Image16* img16 = new Image16 (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, img16);
imgPtr = img16;
}
else if (srcImg->getType() == sImagefloat) {
Imagefloat* castedSrcImg = static_cast<Imagefloat*>(srcImg);
Imagefloat* imgfloat = new Imagefloat (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, imgfloat);
imgPtr = imgfloat;
}
return imgPtr;
}
static Thumbnail* loadQuickFromRaw (const Glib::ustring& fname, rtengine::RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate, bool inspectorMode = false);
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, double wbEq, bool rotate);
static Thumbnail* loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode = false);
static RawMetaDataLocation loadMetaDataFromRaw (const Glib::ustring& fname);
template<class IC>
static IC* resizeTo(int nw, int nh, TypeInterpolation interp, ImageIO* srcImg) {
void getCamWB (double& temp, double& green);
void getAutoWB (double& temp, double& green, double equal);
void getAutoWBMultipliers (double& rm, double& gm, double& bm);
void getSpotWB (const procparams::ProcParams& params, int x, int y, int rect, double& temp, double& green);
void applyAutoExp (procparams::ProcParams& pparams);
IC* imgPtr = new IC (nw, nh);
unsigned char* getGrayscaleHistEQ (int trim_width);
bool writeImage (const Glib::ustring& fname, int format);
bool readImage (const Glib::ustring& fname);
// Hombre: ... let's hope that proper template can make this cleaner
bool readData (const Glib::ustring& fname);
bool writeData (const Glib::ustring& fname);
if (srcImg->getType() == sImage8) {
Image8* castedSrcImg = static_cast<Image8*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
}
else if (srcImg->getType() == sImage16) {
Image16* castedSrcImg = static_cast<Image16*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
}
else if (srcImg->getType() == sImagefloat) {
Imagefloat* castedSrcImg = static_cast<Imagefloat*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
}
return imgPtr;
};
bool readEmbProfile (const Glib::ustring& fname);
bool writeEmbProfile (const Glib::ustring& fname);
bool readAEHistogram (const Glib::ustring& fname);
bool writeAEHistogram (const Glib::ustring& fname);
unsigned char* getImage8Data(); // accessor to the 8bit image if it is one, which should be the case for the "Inspector" mode.
// Hombre: ... let's hope that proper template can make this cleaner
static ImageIO* resizeToSameType(int nw, int nh, TypeInterpolation interp, ImageIO* srcImg)
{
ImageIO* imgPtr;
if (srcImg->getType() == sImage8) {
Image8* castedSrcImg = static_cast<Image8*>(srcImg);
Image8* img8 = new Image8 (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, img8);
imgPtr = img8;
} else if (srcImg->getType() == sImage16) {
Image16* castedSrcImg = static_cast<Image16*>(srcImg);
Image16* img16 = new Image16 (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, img16);
imgPtr = img16;
} else if (srcImg->getType() == sImagefloat) {
Imagefloat* castedSrcImg = static_cast<Imagefloat*>(srcImg);
Imagefloat* imgfloat = new Imagefloat (nw, nh);
castedSrcImg->resizeImgTo(nw, nh, interp, imgfloat);
imgPtr = imgfloat;
}
return imgPtr;
}
template<class IC>
static IC* resizeTo(int nw, int nh, TypeInterpolation interp, ImageIO* srcImg)
{
IC* imgPtr = new IC (nw, nh);
// Hombre: ... let's hope that proper template can make this cleaner
if (srcImg->getType() == sImage8) {
Image8* castedSrcImg = static_cast<Image8*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
} else if (srcImg->getType() == sImage16) {
Image16* castedSrcImg = static_cast<Image16*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
} else if (srcImg->getType() == sImagefloat) {
Imagefloat* castedSrcImg = static_cast<Imagefloat*>(srcImg);
castedSrcImg->resizeImgTo<>(nw, nh, interp, imgPtr);
}
return imgPtr;
};
};
}