Merge branch 'dev' into spot-removal-tool
This commit is contained in:
@@ -28,11 +28,12 @@
|
||||
#define IMIO_FILETYPENOTSUPPORTED 6
|
||||
#define IMIO_CANNOTWRITEFILE 7
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <libiptcdata/iptc-data.h>
|
||||
#include "rtengine.h"
|
||||
#include "imageformat.h"
|
||||
#include <glibmm.h>
|
||||
#include "procparams.h"
|
||||
#include <libiptcdata/iptc-data.h>
|
||||
#include "../rtexif/rtexif.h"
|
||||
#include "imagedimensions.h"
|
||||
#include "iimage.h"
|
||||
@@ -55,7 +56,7 @@ protected:
|
||||
char* loadedProfileData;
|
||||
bool loadedProfileDataJpg;
|
||||
int loadedProfileLength;
|
||||
procparams::ExifPairs exifChange;
|
||||
const std::unique_ptr<procparams::ExifPairs> exifChange;
|
||||
IptcData* iptc;
|
||||
const rtexif::TagDirectory* exifRoot;
|
||||
MyMutex imutex;
|
||||
@@ -63,100 +64,50 @@ protected:
|
||||
IIOSampleArrangement sampleArrangement;
|
||||
|
||||
private:
|
||||
void deleteLoadedProfileData( )
|
||||
{
|
||||
if(loadedProfileData) {
|
||||
if(loadedProfileDataJpg) {
|
||||
free(loadedProfileData);
|
||||
} else {
|
||||
delete[] loadedProfileData;
|
||||
}
|
||||
}
|
||||
void deleteLoadedProfileData( );
|
||||
|
||||
loadedProfileData = nullptr;
|
||||
}
|
||||
public:
|
||||
static Glib::ustring errorMsg[6];
|
||||
|
||||
ImageIO () : pl (nullptr), embProfile(nullptr), profileData(nullptr), profileLength(0), loadedProfileData(nullptr), loadedProfileDataJpg(false),
|
||||
loadedProfileLength(0), iptc(nullptr), exifRoot (nullptr), sampleFormat(IIOSF_UNKNOWN),
|
||||
sampleArrangement(IIOSA_UNKNOWN) {}
|
||||
ImageIO();
|
||||
~ImageIO() override;
|
||||
|
||||
virtual ~ImageIO ();
|
||||
void setProgressListener (ProgressListener* l);
|
||||
void setSampleFormat(IIOSampleFormat sFormat);
|
||||
IIOSampleFormat getSampleFormat() const;
|
||||
void setSampleArrangement(IIOSampleArrangement sArrangement);
|
||||
IIOSampleArrangement getSampleArrangement() const;
|
||||
|
||||
void setProgressListener (ProgressListener* l)
|
||||
{
|
||||
pl = l;
|
||||
}
|
||||
virtual void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp) const = 0;
|
||||
virtual int getBPS () const = 0;
|
||||
virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const = 0;
|
||||
virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples = 3) = 0;
|
||||
virtual const char* getType () const = 0;
|
||||
|
||||
void setSampleFormat(IIOSampleFormat sFormat)
|
||||
{
|
||||
sampleFormat = sFormat;
|
||||
}
|
||||
IIOSampleFormat getSampleFormat()
|
||||
{
|
||||
return sampleFormat;
|
||||
}
|
||||
void setSampleArrangement(IIOSampleArrangement sArrangement)
|
||||
{
|
||||
sampleArrangement = sArrangement;
|
||||
}
|
||||
IIOSampleArrangement getSampleArrangement()
|
||||
{
|
||||
return sampleArrangement;
|
||||
}
|
||||
int load (const Glib::ustring &fname);
|
||||
int save (const Glib::ustring &fname) const;
|
||||
|
||||
virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, const PreviewProps & pp, bool first, procparams::ToneCurveParams hrp)
|
||||
{
|
||||
printf("getStdImage NULL!\n");
|
||||
}
|
||||
|
||||
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] = nullptr, float maxValue[3] = nullptr) {}
|
||||
|
||||
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 loadPNG (const Glib::ustring &fname);
|
||||
int loadJPEG (const Glib::ustring &fname);
|
||||
int loadTIFF (const Glib::ustring &fname);
|
||||
static int getPNGSampleFormat (const Glib::ustring &fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement);
|
||||
static int getTIFFSampleFormat (const 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, 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);
|
||||
int savePNG (const Glib::ustring &fname, int bps = -1) const;
|
||||
int saveJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const;
|
||||
int saveTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const;
|
||||
|
||||
cmsHPROFILE getEmbeddedProfile ()
|
||||
{
|
||||
return embProfile;
|
||||
}
|
||||
void getEmbeddedProfileData (int& length, unsigned char*& pdata)
|
||||
{
|
||||
length = loadedProfileLength;
|
||||
pdata = (unsigned char*)loadedProfileData;
|
||||
}
|
||||
cmsHPROFILE getEmbeddedProfile () const;
|
||||
void getEmbeddedProfileData (int& length, unsigned char*& pdata) const;
|
||||
|
||||
void setMetadata (const rtexif::TagDirectory* eroot);
|
||||
void setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc);
|
||||
void setOutputProfile (const char* pdata, int plen);
|
||||
MyMutex& mutex ()
|
||||
{
|
||||
return imutex;
|
||||
}
|
||||
void setOutputProfile (const char* pdata, int plen);
|
||||
|
||||
MyMutex& mutex ();
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user