Changes to black compression and saturation controls. Black compression from 0-50 acts the same as 0-100 on the previous version, compressing dark tones without crushing blacks. 50-100 then starts crushing blacks until by 100 on the slider, all tones up to the set black point are sent to zero. In the new saturation control, negative values of the slider set a linear curve rather than an inverted S curve, and smoothly decrease saturation to zero across the board.

This commit is contained in:
Emil Martinec
2010-10-26 22:59:18 -05:00
commit 926056c2c2
620 changed files with 130476 additions and 0 deletions

88
rtengine/imageio.h Normal file
View File

@@ -0,0 +1,88 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _IMAGEIO_
#define _IMAGEIO_
#define IMIO_SUCCESS 0
#define IMIO_CANNOTREADFILE 1
#define IMIO_INVALIDHEADER 2
#define IMIO_HEADERERROR 3
#define IMIO_READERROR 4
#define IMIO_VARIANTNOTSUPPORTED 5
#define IMIO_FILETYPENOTSUPPORTED 6
#include <rtengine.h>
#include <glibmm.h>
#include <procparams.h>
#include <libiptcdata/iptc-data.h>
#include <rtexif.h>
namespace rtengine {
class ImageIO {
protected:
ProgressListener* pl;
cmsHPROFILE embProfile;
char* profileData;
int profileLength;
char* loadedProfileData;
int loadedProfileLength;
std::vector<std::pair<std::string,std::string> > exifChange;
IptcData* iptc;
const rtexif::TagDirectory* exifRoot;
Glib::Mutex imutex;
public:
static Glib::ustring errorMsg[6];
ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), loadedProfileData(NULL), loadedProfileLength(0), iptc(NULL), exifRoot (NULL) {}
virtual ~ImageIO ();
void setProgressListener (ProgressListener* l) { pl = l; }
virtual int getW () =0;
virtual int getH () =0;
virtual void allocate (int width, int height) =0;
virtual int getBPS () =0;
virtual void getScanline (int row, unsigned char* buffer, int bps) {}
virtual void setScanline (int row, unsigned char* buffer, int bps) {}
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);
int savePNG (Glib::ustring fname, int compression = -1, int bps = -1);
int saveJPEG (Glib::ustring fname, int quality = 100);
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, const std::vector<rtengine::procparams::ExifPair>& exif, const std::vector<rtengine::procparams::IPTCPair>& iptcc);
void setOutputProfile (char* pdata, int plen);
Glib::Mutex& mutex () { return imutex; }
};
};
#endif