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
@@ -37,105 +37,150 @@
#include "iimage.h"
#include "colortemp.h"
namespace rtengine {
namespace rtengine
{
class ProgressListener;
class Imagefloat;
class ProgressListener;
class Imagefloat;
typedef enum IIO_Sample_Format {
IIOSF_UNKNOWN = 0, // Unknown or Unsupported file type; Has to remain 0
//IIOSF_SIGNED_INT , // Not yet supported
IIOSF_UNSIGNED_CHAR = 1<<0,
IIOSF_UNSIGNED_SHORT = 1<<1,
//IIOSF_HALF , // OpenEXR & NVidia's Half Float, not yet supported
IIOSF_LOGLUV24 = 1<<2,
IIOSF_LOGLUV32 = 1<<3,
IIOSF_FLOAT = 1<<4
} IIOSampleFormat;
typedef enum IIO_Sample_Format {
IIOSF_UNKNOWN = 0, // Unknown or Unsupported file type; Has to remain 0
//IIOSF_SIGNED_INT , // Not yet supported
IIOSF_UNSIGNED_CHAR = 1 << 0,
IIOSF_UNSIGNED_SHORT = 1 << 1,
//IIOSF_HALF , // OpenEXR & NVidia's Half Float, not yet supported
IIOSF_LOGLUV24 = 1 << 2,
IIOSF_LOGLUV32 = 1 << 3,
IIOSF_FLOAT = 1 << 4
} IIOSampleFormat;
typedef enum IIO_Sample_Arrangement {
IIOSA_UNKNOWN, // Unknown or Unsupported file type
IIOSA_CHUNKY,
IIOSA_PLANAR
} IIOSampleArrangement;
typedef enum IIO_Sample_Arrangement {
IIOSA_UNKNOWN, // Unknown or Unsupported file type
IIOSA_CHUNKY,
IIOSA_PLANAR
} IIOSampleArrangement;
typedef enum SensorType {
ST_NONE, // use this value if the image is already demosaiced (i.e. not a raw file)
ST_BAYER,
ST_FUJI_XTRANS,
ST_FOVEON,
//ST_FUJI_EXR
} eSensorType;
typedef enum SensorType {
ST_NONE, // use this value if the image is already demosaiced (i.e. not a raw file)
ST_BAYER,
ST_FUJI_XTRANS,
ST_FOVEON,
//ST_FUJI_EXR
} eSensorType;
class ImageIO : virtual public ImageDatas {
class ImageIO : virtual public ImageDatas
{
protected:
ProgressListener* pl;
cmsHPROFILE embProfile;
char* profileData;
int profileLength;
char* loadedProfileData;
bool loadedProfileDataJpg;
int loadedProfileLength;
procparams::ExifPairs exifChange;
IptcData* iptc;
const rtexif::TagDirectory* exifRoot;
MyMutex imutex;
IIOSampleFormat sampleFormat;
IIOSampleArrangement sampleArrangement;
protected:
ProgressListener* pl;
cmsHPROFILE embProfile;
char* profileData;
int profileLength;
char* loadedProfileData;
bool loadedProfileDataJpg;
int loadedProfileLength;
procparams::ExifPairs exifChange;
IptcData* iptc;
const rtexif::TagDirectory* exifRoot;
MyMutex imutex;
IIOSampleFormat sampleFormat;
IIOSampleArrangement sampleArrangement;
private:
void deleteLoadedProfileData( ) { if(loadedProfileData) {if(loadedProfileDataJpg) free(loadedProfileData); else delete[] loadedProfileData;} loadedProfileData = NULL; }
public:
static Glib::ustring errorMsg[6];
ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), profileLength(0), loadedProfileData(NULL),loadedProfileDataJpg(false),
loadedProfileLength(0), iptc(NULL), exifRoot (NULL), sampleFormat(IIOSF_UNKNOWN),
sampleArrangement(IIOSA_UNKNOWN) {}
virtual ~ImageIO ();
void setProgressListener (ProgressListener* l) { pl = l; }
void setSampleFormat(IIOSampleFormat sFormat) { sampleFormat = sFormat; }
IIOSampleFormat getSampleFormat() { return sampleFormat; }
void setSampleArrangement(IIOSampleArrangement sArrangement) { sampleArrangement = sArrangement; }
IIOSampleArrangement getSampleArrangement() { return sampleArrangement; }
virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) {
printf("getStdImage NULL!\n");
private:
void deleteLoadedProfileData( )
{
if(loadedProfileData) {
if(loadedProfileDataJpg) {
free(loadedProfileData);
} else {
delete[] loadedProfileData;
}
}
virtual int getBPS () =0;
virtual void getScanline (int row, unsigned char* buffer, int bps) {}
virtual void setScanline (int row, unsigned char* buffer, int bps, float minValue[3]=NULL, float maxValue[3]=NULL) {}
loadedProfileData = NULL;
}
public:
static Glib::ustring errorMsg[6];
virtual bool readImage (Glib::ustring &fname, FILE *fh) { return false; };
virtual bool writeImage (Glib::ustring &fname, FILE *fh) { return false; };
ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), profileLength(0), loadedProfileData(NULL), loadedProfileDataJpg(false),
loadedProfileLength(0), iptc(NULL), exifRoot (NULL), sampleFormat(IIOSF_UNKNOWN),
sampleArrangement(IIOSA_UNKNOWN) {}
int load (Glib::ustring fname);
int save (Glib::ustring fname);
virtual ~ImageIO ();
int loadPNG (Glib::ustring fname);
int loadJPEG (Glib::ustring fname);
int loadTIFF (Glib::ustring fname);
static int getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement);
static int getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement);
void setProgressListener (ProgressListener* l)
{
pl = l;
}
int loadJPEGFromMemory (const char* buffer, int bufsize);
int loadPPMFromMemory(const char* buffer,int width,int height, bool swap, int bps);
void setSampleFormat(IIOSampleFormat sFormat)
{
sampleFormat = sFormat;
}
IIOSampleFormat getSampleFormat()
{
return sampleFormat;
}
void setSampleArrangement(IIOSampleArrangement sArrangement)
{
sampleArrangement = sArrangement;
}
IIOSampleArrangement getSampleArrangement()
{
return sampleArrangement;
}
int savePNG (Glib::ustring fname, int compression = -1, volatile int bps = -1);
int saveJPEG (Glib::ustring fname, int quality = 100, int subSamp=3);
int saveTIFF (Glib::ustring fname, int bps = -1, bool uncompressed = false);
virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
{
printf("getStdImage NULL!\n");
}
cmsHPROFILE getEmbeddedProfile () { return embProfile; }
void getEmbeddedProfileData (int& length, unsigned char*& pdata) { length = loadedProfileLength; pdata = (unsigned char*)loadedProfileData; }
virtual int getBPS () = 0;
virtual void getScanline (int row, unsigned char* buffer, int bps) {}
virtual void setScanline (int row, unsigned char* buffer, int bps, float minValue[3] = NULL, float maxValue[3] = NULL) {}
void setMetadata (const rtexif::TagDirectory* eroot);
void setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc);
void setOutputProfile (char* pdata, int plen);
MyMutex& mutex () { return imutex; }
virtual bool readImage (Glib::ustring &fname, FILE *fh)
{
return false;
};
virtual bool writeImage (Glib::ustring &fname, FILE *fh)
{
return false;
};
int load (Glib::ustring fname);
int save (Glib::ustring fname);
int loadPNG (Glib::ustring fname);
int loadJPEG (Glib::ustring fname);
int loadTIFF (Glib::ustring fname);
static int getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement);
static int getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement);
int loadJPEGFromMemory (const char* buffer, int bufsize);
int loadPPMFromMemory(const char* buffer, int width, int height, bool swap, int bps);
int savePNG (Glib::ustring fname, int compression = -1, volatile int bps = -1);
int saveJPEG (Glib::ustring fname, int quality = 100, int subSamp = 3);
int saveTIFF (Glib::ustring fname, int bps = -1, bool uncompressed = false);
cmsHPROFILE getEmbeddedProfile ()
{
return embProfile;
}
void getEmbeddedProfileData (int& length, unsigned char*& pdata)
{
length = loadedProfileLength;
pdata = (unsigned char*)loadedProfileData;
}
void setMetadata (const rtexif::TagDirectory* eroot);
void setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc);
void setOutputProfile (char* pdata, int plen);
MyMutex& mutex ()
{
return imutex;
}
};
}