Fix dcp.cc with some help from the implementation in ART

This commit is contained in:
Thanatomanic 2020-10-16 12:39:17 +02:00
parent 8b4389ade9
commit d9799ec5de
8 changed files with 327 additions and 389 deletions

View File

@ -20,4 +20,3 @@ del .\rtdata\Makefile
del .\rtengine\librtengine.so
del .\rtengine\librtengine.a
del .\rtgui\rawtherapee
del .\rtexif\librtexif.a

View File

@ -1,4 +1,3 @@
<<<<<<< HEAD
if(EXTRA_INCDIR)
include_directories("${EXTRA_INCDIR}")
endif()

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,20 @@ class DCPProfileApplyState;
class DCPProfile final
{
public:
class ApplyState final
{
public:
ApplyState();
~ApplyState();
private:
struct Data;
std::unique_ptr<Data> data;
friend class DCPProfile;
};
struct Illuminants {
short light_source_1;
short light_source_2;
@ -72,10 +86,11 @@ public:
const ColorTemp& white_balance,
const Triple& pre_mul,
const Matrix& cam_wb_matrix,
bool apply_hue_sat_map = true
bool apply_hue_sat_map,
bool apply_look_table
) const;
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out);
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const;
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out);
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const ApplyState& as_in) const;
private:
struct HsbModify {
@ -136,20 +151,6 @@ private:
AdobeToneCurve tone_curve;
};
class DCPProfileApplyState final
{
public:
DCPProfileApplyState();
~DCPProfileApplyState();
private:
struct Data;
const std::unique_ptr<Data> data;
friend class DCPProfile;
};
class DCPStore final :
public NonCopyable
{
@ -171,10 +172,10 @@ private:
std::vector<Glib::ustring> profileDir;
// these contain standard profiles from RT. keys are all in uppercase, file path is value
std::map<std::string, Glib::ustring> file_std_profiles;
std::map<Glib::ustring, Glib::ustring> file_std_profiles;
// Maps file name to profile as cache
mutable std::map<std::string, DCPProfile*> profile_cache;
mutable std::map<Glib::ustring, DCPProfile*> profile_cache;
};
}

View File

@ -29,7 +29,6 @@
#include "utils.h"
#include "../rtgui/options.h"
#include "../rtgui/version.h"
#include "../rtexif/rtexif.h"
#ifdef WIN32
#include <winsock2.h>
@ -1177,6 +1176,10 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u
TIFFSetField (out, TIFFTAG_COMPRESSION, uncompressed ? COMPRESSION_NONE : COMPRESSION_ADOBE_DEFLATE);
TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, (bps == 16 || bps == 32) && isFloat ? SAMPLEFORMAT_IEEEFP : SAMPLEFORMAT_UINT);
/*
TODO: Re-apply fix from #5787
[out]()
{
const std::vector<rtexif::Tag*> default_tags = rtexif::ExifManager::getDefaultTIFFTags(nullptr);
@ -1188,7 +1191,7 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u
for (auto default_tag : default_tags) {
delete default_tag;
}
}();
}();*/
if (!uncompressed) {
TIFFSetField (out, TIFFTAG_PREDICTOR, (bps == 16 || bps == 32) && isFloat ? PREDICTOR_FLOATINGPOINT : PREDICTOR_HORIZONTAL);

View File

@ -47,12 +47,6 @@ class LUT;
using LUTu = LUT<uint32_t>;
class EditDataProvider;
namespace rtexif
{
class TagDirectory;
}
namespace rtengine
{

View File

@ -24,7 +24,6 @@
#include "image8.h"
#include "imagefloat.h"
#include "LUT.h"
#include "rawmetadatalocation.h"
#include "../rtgui/threadutils.h"

View File

@ -23,7 +23,6 @@
#include <gtkmm.h>
#include "toolpanel.h"
#include "../rtexif/rtexif.h"
namespace rtengine
{