Review of image classes interfaces, part 3

This commit is contained in:
heckflosse
2018-11-19 14:12:16 +01:00
parent 512adf5b62
commit 5b3fd8ddba
3 changed files with 47 additions and 42 deletions

View File

@@ -45,61 +45,62 @@ public:
Image8* to8() const; Image8* to8() const;
Imagefloat* tofloat() const; Imagefloat* tofloat() const;
virtual void getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const; void getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override;
virtual const char* getType() const const char* getType() const override
{ {
return sImage16; return sImage16;
} }
virtual int getBPS() const int getBPS() const override
{ {
return 8 * sizeof(unsigned short); return 8 * sizeof(unsigned short);
} }
virtual void getScanline(int row, unsigned char* buffer, int bps, bool isFloat = false) const;
virtual void setScanline(int row, unsigned char* buffer, int bps, unsigned int numSamples); void getScanline(int row, unsigned char* buffer, int bps, bool isFloat = false) const override;
void setScanline(int row, unsigned char* buffer, int bps, unsigned int numSamples) override;
// functions inherited from IImage16: // functions inherited from IImage16:
virtual MyMutex& getMutex() MyMutex& getMutex() override
{ {
return mutex(); return mutex();
} }
virtual cmsHPROFILE getProfile() const cmsHPROFILE getProfile() const override
{ {
return getEmbeddedProfile(); return getEmbeddedProfile();
} }
virtual int getBitsPerPixel() const int getBitsPerPixel() const override
{ {
return 8 * sizeof(unsigned short); return 8 * sizeof(unsigned short);
} }
virtual int saveToFile(const Glib::ustring &fname) const int saveToFile(const Glib::ustring &fname) const override
{ {
return save(fname); return save(fname);
} }
virtual int saveAsPNG(const Glib::ustring &fname, int bps = -1) const saveAsPNG(const Glib::ustring &fname, int bps = -1) const override
{ {
return savePNG(fname, bps); return savePNG(fname, bps);
} }
virtual int saveAsJPEG(const Glib::ustring &fname, int quality = 100, int subSamp = 3) const int saveAsJPEG(const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override
{ {
return saveJPEG(fname, quality, subSamp); return saveJPEG(fname, quality, subSamp);
} }
virtual int saveAsTIFF(const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const int saveAsTIFF(const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override
{ {
return saveTIFF(fname, bps, isFloat, uncompressed); return saveTIFF(fname, bps, isFloat, uncompressed);
} }
virtual void setSaveProgressListener(ProgressListener* pl) void setSaveProgressListener(ProgressListener* pl) override
{ {
setProgressListener(pl); setProgressListener(pl);
} }
virtual void free() void free() override
{ {
delete this; delete this;
} }

View File

@@ -40,61 +40,63 @@ public:
Image8* copy () const; Image8* copy () const;
virtual void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const; void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override;
virtual const char* getType () const const char* getType () const override
{ {
return sImage8; return sImage8;
} }
virtual int getBPS () const
int getBPS () const override
{ {
return 8 * sizeof(unsigned char); return 8 * sizeof(unsigned char);
} }
virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const;
virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples); void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const override;
void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples) override;
// functions inherited from IImage*: // functions inherited from IImage*:
virtual MyMutex& getMutex () MyMutex& getMutex () override
{ {
return mutex (); return mutex ();
} }
virtual cmsHPROFILE getProfile () const cmsHPROFILE getProfile () const override
{ {
return getEmbeddedProfile (); return getEmbeddedProfile ();
} }
virtual int getBitsPerPixel () const int getBitsPerPixel () const override
{ {
return 8 * sizeof(unsigned char); return 8 * sizeof(unsigned char);
} }
virtual int saveToFile (const Glib::ustring &fname) const int saveToFile (const Glib::ustring &fname) const override
{ {
return save (fname); return save (fname);
} }
virtual int saveAsPNG (const Glib::ustring &fname, int bps = -1) const int saveAsPNG (const Glib::ustring &fname, int bps = -1) const override
{ {
return savePNG (fname, bps); return savePNG (fname, bps);
} }
virtual int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override
{ {
return saveJPEG (fname, quality, subSamp); return saveJPEG (fname, quality, subSamp);
} }
virtual int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override
{ {
return saveTIFF (fname, bps, isFloat, uncompressed); return saveTIFF (fname, bps, isFloat, uncompressed);
} }
virtual void setSaveProgressListener (ProgressListener* pl) void setSaveProgressListener (ProgressListener* pl) override
{ {
setProgressListener (pl); setProgressListener (pl);
} }
virtual void free () void free () override
{ {
delete this; delete this;
} }

View File

@@ -49,53 +49,55 @@ public:
Image8* to8() const; Image8* to8() const;
Image16* to16() const; Image16* to16() const;
virtual void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const; void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override;
virtual const char* getType () const const char* getType () const override
{ {
return sImagefloat; return sImagefloat;
} }
virtual int getBPS () const
int getBPS () const override
{ {
return 8 * sizeof(float); return 8 * sizeof(float);
} }
virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const;
virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples); void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const override;
void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples) override;
// functions inherited from IImagefloat: // functions inherited from IImagefloat:
virtual MyMutex& getMutex () MyMutex& getMutex () override
{ {
return mutex (); return mutex ();
} }
virtual cmsHPROFILE getProfile () const cmsHPROFILE getProfile () const override
{ {
return getEmbeddedProfile (); return getEmbeddedProfile ();
} }
virtual int getBitsPerPixel () const int getBitsPerPixel () const override
{ {
return 8 * sizeof(float); return 8 * sizeof(float);
} }
virtual int saveToFile (const Glib::ustring &fname) const int saveToFile (const Glib::ustring &fname) const override
{ {
return save (fname); return save (fname);
} }
virtual int saveAsPNG (const Glib::ustring &fname, int bps = -1) const int saveAsPNG (const Glib::ustring &fname, int bps = -1) const override
{ {
return savePNG (fname, bps); return savePNG (fname, bps);
} }
virtual int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override
{ {
return saveJPEG (fname, quality, subSamp); return saveJPEG (fname, quality, subSamp);
} }
virtual int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override
{ {
return saveTIFF (fname, bps, isFloat, uncompressed); return saveTIFF (fname, bps, isFloat, uncompressed);
} }
virtual void setSaveProgressListener (ProgressListener* pl) void setSaveProgressListener (ProgressListener* pl) override
{ {
setProgressListener (pl); setProgressListener (pl);
} }
virtual void free () void free () override
{ {
delete this; delete this;
} }