Review of image classes interfaces
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
#define IMIO_FILETYPENOTSUPPORTED 6
|
||||
#define IMIO_CANNOTWRITEFILE 7
|
||||
|
||||
#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"
|
||||
@@ -63,18 +63,8 @@ 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];
|
||||
|
||||
@@ -84,75 +74,41 @@ public:
|
||||
|
||||
virtual ~ImageIO ();
|
||||
|
||||
void setProgressListener (ProgressListener* l)
|
||||
{
|
||||
pl = l;
|
||||
}
|
||||
void setProgressListener (ProgressListener* l);
|
||||
void setSampleFormat(IIOSampleFormat sFormat);
|
||||
IIOSampleFormat getSampleFormat() const;
|
||||
void setSampleArrangement(IIOSampleArrangement sArrangement);
|
||||
IIOSampleArrangement getSampleArrangement() const;
|
||||
|
||||
void setSampleFormat(IIOSampleFormat sFormat)
|
||||
{
|
||||
sampleFormat = sFormat;
|
||||
}
|
||||
IIOSampleFormat getSampleFormat()
|
||||
{
|
||||
return sampleFormat;
|
||||
}
|
||||
void setSampleArrangement(IIOSampleArrangement sArrangement)
|
||||
{
|
||||
sampleArrangement = sArrangement;
|
||||
}
|
||||
IIOSampleArrangement getSampleArrangement()
|
||||
{
|
||||
return sampleArrangement;
|
||||
}
|
||||
virtual void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, 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 void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp) = 0;
|
||||
virtual int getBPS () = 0;
|
||||
virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) {}
|
||||
virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples = 3) {}
|
||||
int load (const Glib::ustring &fname);
|
||||
int save (const Glib::ustring &fname) const;
|
||||
|
||||
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, float isFloat = false, 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