Hi,
It's been a while since I've dug into the UFRaw sources.
The patch below basically does two things:
1. Minor metadata fix for TIFF Compression.
2. Add UFRaw internal sRGB/AdobeRGB colorspaces (with more sensible
metadata), and allow to embed them into outputted files.
As I said, I'm quite rusty on the UFRaw codebase, it seems to work
over here, but please do carefully verify before committing.
Another thought, is, if there any interest in having camera specific
default gamma + linearity values... For example when gamma is set to
0.30 and linearity is set to 0.050, UFRaw's output more or less
matches the camera JPEG output, which may or may not be good, but it
is a generally expected starting point.
Regards,
Pascal de Bruijn
diff -Nurpd ufraw-cvs/colorspaces.c ufraw-dev/colorspaces.c
--- ufraw-cvs/colorspaces.c 1970-01-01 01:00:00.000000000 +0100
+++ ufraw-dev/colorspaces.c 2014-01-24 19:02:42.311195881 +0100
@@ -0,0 +1,122 @@
+#include "ufraw.h"
+#include "stdint.h"
+#include "srgb_tone_curve_values.h"
+#include <lcms2.h>
+
+cmsHPROFILE
+ufraw_colorspaces_create_srgb_profile()
+{
+ cmsHPROFILE hsRGB;
+
+ cmsCIEXYZTRIPLE Colorants =
+ {
+ {0.436066, 0.222488, 0.013916},
+ {0.385147, 0.716873, 0.097076},
+ {0.143066, 0.060608, 0.714096}
+ };
+
+ cmsCIEXYZ black = { 0, 0, 0 };
+ cmsCIEXYZ D65 = { 0.95045, 1, 1.08905 };
+ cmsToneCurve* transferFunction;
+
+ transferFunction = cmsBuildTabulatedToneCurve16(NULL, ufraw_srgb_tone_curve_values_n, ufraw_srgb_tone_curve_values);
+
+ hsRGB = cmsCreateProfilePlaceholder(0);
+
+ cmsSetProfileVersion(hsRGB, 2.1);
+
+ cmsMLU *mlu0 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu0, "en", "US", "Public Domain");
+ cmsMLU *mlu1 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu1, "en", "US", "sRGB");
+ cmsMLU *mlu2 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu2, "en", "US", "UFRaw");
+ cmsMLU *mlu3 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu3, "en", "US", "sRGB");
+ // this will only be displayed when the embedded profile is read by for example GIMP
+ cmsWriteTag(hsRGB, cmsSigCopyrightTag, mlu0);
+ cmsWriteTag(hsRGB, cmsSigProfileDescriptionTag, mlu1);
+ cmsWriteTag(hsRGB, cmsSigDeviceMfgDescTag, mlu2);
+ cmsWriteTag(hsRGB, cmsSigDeviceModelDescTag, mlu3);
+ cmsMLUfree(mlu0);
+ cmsMLUfree(mlu1);
+ cmsMLUfree(mlu2);
+ cmsMLUfree(mlu3);
+
+ cmsSetDeviceClass(hsRGB, cmsSigDisplayClass);
+ cmsSetColorSpace(hsRGB, cmsSigRgbData);
+ cmsSetPCS(hsRGB, cmsSigXYZData);
+
+ cmsWriteTag(hsRGB, cmsSigMediaWhitePointTag, &D65);
+ cmsWriteTag(hsRGB, cmsSigMediaBlackPointTag, &black);
+
+ cmsWriteTag(hsRGB, cmsSigRedColorantTag, (void*) &Colorants.Red);
+ cmsWriteTag(hsRGB, cmsSigGreenColorantTag, (void*) &Colorants.Green);
+ cmsWriteTag(hsRGB, cmsSigBlueColorantTag, (void*) &Colorants.Blue);
+
+ cmsWriteTag(hsRGB, cmsSigRedTRCTag, (void*) transferFunction);
+ cmsLinkTag(hsRGB, cmsSigGreenTRCTag, cmsSigRedTRCTag );
+ cmsLinkTag(hsRGB, cmsSigBlueTRCTag, cmsSigRedTRCTag );
+
+ return hsRGB;
+}
+
+// Create the ICC virtual profile for adobe rgb space
+cmsHPROFILE
+ufraw_colorspaces_create_adobergb_profile(void)
+{
+ cmsHPROFILE hAdobeRGB;
+
+ cmsCIEXYZTRIPLE Colorants =
+ {
+ {0.609741, 0.311111, 0.019470},
+ {0.205276, 0.625671, 0.060867},
+ {0.149185, 0.063217, 0.744568}
+ };
+
+ cmsCIEXYZ black = { 0, 0, 0 };
+ cmsCIEXYZ D65 = { 0.95045, 1, 1.08905 };
+ cmsToneCurve* transferFunction;
+
+ // AdobeRGB's "2.2" gamma is technically defined as 2 + 51/256
+ transferFunction = cmsBuildGamma(NULL, 2.19921875);
+
+ hAdobeRGB = cmsCreateProfilePlaceholder(0);
+
+ cmsSetProfileVersion(hAdobeRGB, 2.1);
+
+ cmsMLU *mlu0 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu0, "en", "US", "Public Domain");
+ cmsMLU *mlu1 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu1, "en", "US", "Adobe RGB (compatible)");
+ cmsMLU *mlu2 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu2, "en", "US", "UFRaw");
+ cmsMLU *mlu3 = cmsMLUalloc(NULL, 1);
+ cmsMLUsetASCII(mlu3, "en", "US", "Adobe RGB");
+ // this will only be displayed when the embedded profile is read by for example GIMP
+ cmsWriteTag(hAdobeRGB, cmsSigCopyrightTag, mlu0);
+ cmsWriteTag(hAdobeRGB, cmsSigProfileDescriptionTag, mlu1);
+ cmsWriteTag(hAdobeRGB, cmsSigDeviceMfgDescTag, mlu2);
+ cmsWriteTag(hAdobeRGB, cmsSigDeviceModelDescTag, mlu3);
+ cmsMLUfree(mlu0);
+ cmsMLUfree(mlu1);
+ cmsMLUfree(mlu2);
+ cmsMLUfree(mlu3);
+
+ cmsSetDeviceClass(hAdobeRGB, cmsSigDisplayClass);
+ cmsSetColorSpace(hAdobeRGB, cmsSigRgbData);
+ cmsSetPCS(hAdobeRGB, cmsSigXYZData);
+
+ cmsWriteTag(hAdobeRGB, cmsSigMediaWhitePointTag, &D65);
+ cmsWriteTag(hAdobeRGB, cmsSigMediaBlackPointTag, &black);
+
+ cmsWriteTag(hAdobeRGB, cmsSigRedColorantTag, (void*) &Colorants.Red);
+ cmsWriteTag(hAdobeRGB, cmsSigGreenColorantTag, (void*) &Colorants.Green);
+ cmsWriteTag(hAdobeRGB, cmsSigBlueColorantTag, (void*) &Colorants.Blue);
+
+ cmsWriteTag(hAdobeRGB, cmsSigRedTRCTag, (void*) transferFunction);
+ cmsLinkTag(hAdobeRGB, cmsSigGreenTRCTag, cmsSigRedTRCTag );
+ cmsLinkTag(hAdobeRGB, cmsSigBlueTRCTag, cmsSigRedTRCTag );
+
+ return hAdobeRGB;
+}
diff -Nurpd ufraw-cvs/colorspaces.h ufraw-dev/colorspaces.h
--- ufraw-cvs/colorspaces.h 1970-01-01 01:00:00.000000000 +0100
+++ ufraw-dev/colorspaces.h 2014-01-24 18:37:03.335227768 +0100
@@ -0,0 +1,8 @@
+
+#include <lcms2.h>
+
+/** create the ICC virtual profile for srgb space. */
+cmsHPROFILE ufraw_colorspaces_create_srgb_profile(void);
+
+/** create the ICC virtual profile for adobe rgb space. */
+cmsHPROFILE ufraw_colorspaces_create_adobergb_profile(void);
diff -Nurpd ufraw-cvs/Makefile.am ufraw-dev/Makefile.am
--- ufraw-cvs/Makefile.am 2014-01-24 19:50:48.351136079 +0100
+++ ufraw-dev/Makefile.am 2014-01-24 19:51:33.571135142 +0100
@@ -65,7 +65,7 @@ if MAKE_GTK
ufraw_preview.c ufraw_saver.c ufraw_delete.c \
ufraw_chooser.c ufraw_icons.c icons/ufraw_icons.h \
curveeditor_widget.c curveeditor_widget.h \
- ufraw_lens_ui.c ufraw_ui.h
+ ufraw_lens_ui.c ufraw_ui.h colorspaces.c colorspaces.h
else
libufraw_a_SOURCES = \
dcraw.cc ufraw_ufraw.c ufraw_routines.c ufraw_developer.c \
@@ -73,7 +73,7 @@ else
ufobject.cc ufobject.h ufraw_settings.cc ufraw_lensfun.cc \
wb_presets.c dcraw_api.cc dcraw_api.h dcraw_indi.c dcraw.h \
nikon_curve.c nikon_curve.h uf_progress.h \
- uf_glib.h ufraw_exiv2.cc iccjpeg.c iccjpeg.h
+ uf_glib.h ufraw_exiv2.cc iccjpeg.c iccjpeg.h colorspaces.c colorspaces.h
endif
ufraw_batch_LINK = $(CXXLINK) @CONSOLE@
diff -Nurpd ufraw-cvs/srgb_tone_curve_values.h ufraw-dev/srgb_tone_curve_values.h
--- ufraw-cvs/srgb_tone_curve_values.h 1970-01-01 01:00:00.000000000 +0100
+++ ufraw-dev/srgb_tone_curve_values.h 2014-01-24 19:03:30.887194873 +0100
@@ -0,0 +1,1038 @@
+#ifndef __SRGB_TONE_CURVE_VALUES__
+#define __SRGB_TONE_CURVE_VALUES__
+
+static const uint16_t ufraw_srgb_tone_curve_values[] =
+{
+ 0,
+ 5,
+ 10,
+ 15,
+ 20,
+ 25,
+ 30,
+ 35,
+ 40,
+ 45,
+ 50,
+ 55,
+ 59,
+ 64,
+ 69,
+ 74,
+ 79,
+ 84,
+ 89,
+ 94,
+ 99,
+ 104,
+ 109,
+ 114,
+ 119,
+ 124,
+ 129,
+ 134,
+ 139,
+ 144,
+ 149,
+ 154,
+ 159,
+ 164,
+ 169,
+ 174,
+ 178,
+ 183,
+ 188,
+ 193,
+ 198,
+ 203,
+ 208,
+ 213,
+ 219,
+ 224,
+ 229,
+ 235,
+ 240,
+ 246,
+ 251,
+ 257,
+ 263,
+ 269,
+ 275,
+ 281,
+ 287,
+ 293,
+ 299,
+ 306,
+ 312,
+ 318,
+ 325,
+ 332,
+ 338,
+ 345,
+ 352,
+ 359,
+ 366,
+ 373,
+ 380,
+ 387,
+ 395,
+ 402,
+ 410,
+ 417,
+ 425,
+ 433,
+ 441,
+ 449,
+ 457,
+ 465,
+ 473,
+ 481,
+ 489,
+ 498,
+ 506,
+ 515,
+ 524,
+ 532,
+ 541,
+ 550,
+ 559,
+ 568,
+ 577,
+ 587,
+ 596,
+ 605,
+ 615,
+ 625,
+ 634,
+ 644,
+ 654,
+ 664,
+ 674,
+ 684,
+ 694,
+ 705,
+ 715,
+ 725,
+ 736,
+ 747,
+ 757,
+ 768,
+ 779,
+ 790,
+ 801,
+ 813,
+ 824,
+ 835,
+ 847,
+ 858,
+ 870,
+ 882,
+ 894,
+ 906,
+ 918,
+ 930,
+ 942,
+ 954,
+ 967,
+ 979,
+ 992,
+ 1004,
+ 1017,
+ 1030,
+ 1043,
+ 1056,
+ 1069,
+ 1083,
+ 1096,
+ 1109,
+ 1123,
+ 1137,
+ 1150,
+ 1164,
+ 1178,
+ 1192,
+ 1206,
+ 1220,
+ 1235,
+ 1249,
+ 1264,
+ 1278,
+ 1293,
+ 1308,
+ 1323,
+ 1338,
+ 1353,
+ 1368,
+ 1383,
+ 1399,
+ 1414,
+ 1430,
+ 1446,
+ 1461,
+ 1477,
+ 1493,
+ 1509,
+ 1526,
+ 1542,
+ 1558,
+ 1575,
+ 1591,
+ 1608,
+ 1625,
+ 1642,
+ 1659,
+ 1676,
+ 1693,
+ 1711,
+ 1728,
+ 1745,
+ 1763,
+ 1781,
+ 1799,
+ 1817,
+ 1835,
+ 1853,
+ 1871,
+ 1889,
+ 1908,
+ 1926,
+ 1945,
+ 1964,
+ 1983,
+ 2002,
+ 2021,
+ 2040,
+ 2059,
+ 2079,
+ 2098,
+ 2118,
+ 2138,
+ 2158,
+ 2178,
+ 2198,
+ 2218,
+ 2238,
+ 2258,
+ 2279,
+ 2299,
+ 2320,
+ 2341,
+ 2362,
+ 2383,
+ 2404,
+ 2425,
+ 2447,
+ 2468,
+ 2490,
+ 2511,
+ 2533,
+ 2555,
+ 2577,
+ 2599,
+ 2621,
+ 2644,
+ 2666,
+ 2689,
+ 2712,
+ 2734,
+ 2757,
+ 2780,
+ 2803,
+ 2827,
+ 2850,
+ 2873,
+ 2897,
+ 2921,
+ 2944,
+ 2968,
+ 2992,
+ 3016,
+ 3041,
+ 3065,
+ 3090,
+ 3114,
+ 3139,
+ 3164,
+ 3189,
+ 3214,
+ 3239,
+ 3264,
+ 3289,
+ 3315,
+ 3341,
+ 3366,
+ 3392,
+ 3418,
+ 3444,
+ 3470,
+ 3497,
+ 3523,
+ 3550,
+ 3576,
+ 3603,
+ 3630,
+ 3657,
+ 3684,
+ 3711,
+ 3739,
+ 3766,
+ 3794,
+ 3822,
+ 3849,
+ 3877,
+ 3905,
+ 3934,
+ 3962,
+ 3990,
+ 4019,
+ 4047,
+ 4076,
+ 4105,
+ 4134,
+ 4163,
+ 4193,
+ 4222,
+ 4251,
+ 4281,
+ 4311,
+ 4341,
+ 4371,
+ 4401,
+ 4431,
+ 4461,
+ 4492,
+ 4522,
+ 4553,
+ 4584,
+ 4615,
+ 4646,
+ 4677,
+ 4708,
+ 4740,
+ 4771,
+ 4803,
+ 4835,
+ 4867,
+ 4899,
+ 4931,
+ 4963,
+ 4995,
+ 5028,
+ 5061,
+ 5093,
+ 5126,
+ 5159,
+ 5193,
+ 5226,
+ 5259,
+ 5293,
+ 5326,
+ 5360,
+ 5394,
+ 5428,
+ 5462,
+ 5496,
+ 5531,
+ 5565,
+ 5600,
+ 5635,
+ 5670,
+ 5705,
+ 5740,
+ 5775,
+ 5810,
+ 5846,
+ 5882,
+ 5917,
+ 5953,
+ 5989,
+ 6025,
+ 6062,
+ 6098,
+ 6135,
+ 6171,
+ 6208,
+ 6245,
+ 6282,
+ 6319,
+ 6357,
+ 6394,
+ 6432,
+ 6469,
+ 6507,
+ 6545,
+ 6583,
+ 6621,
+ 6660,
+ 6698,
+ 6737,
+ 6775,
+ 6814,
+ 6853,
+ 6892,
+ 6932,
+ 6971,
+ 7011,
+ 7050,
+ 7090,
+ 7130,
+ 7170,
+ 7210,
+ 7250,
+ 7291,
+ 7331,
+ 7372,
+ 7413,
+ 7454,
+ 7495,
+ 7536,
+ 7577,
+ 7619,
+ 7660,
+ 7702,
+ 7744,
+ 7786,
+ 7828,
+ 7870,
+ 7913,
+ 7955,
+ 7998,
+ 8041,
+ 8084,
+ 8127,
+ 8170,
+ 8213,
+ 8257,
+ 8300,
+ 8344,
+ 8388,
+ 8432,
+ 8476,
+ 8520,
+ 8565,
+ 8609,
+ 8654,
+ 8699,
+ 8743,
+ 8789,
+ 8834,
+ 8879,
+ 8925,
+ 8970,
+ 9016,
+ 9062,
+ 9108,
+ 9154,
+ 9200,
+ 9247,
+ 9293,
+ 9340,
+ 9387,
+ 9434,
+ 9481,
+ 9528,
+ 9576,
+ 9623,
+ 9671,
+ 9719,
+ 9767,
+ 9815,
+ 9863,
+ 9911,
+ 9960,
+ 10008,
+ 10057,
+ 10106,
+ 10155,
+ 10204,
+ 10253,
+ 10303,
+ 10353,
+ 10402,
+ 10452,
+ 10502,
+ 10552,
+ 10603,
+ 10653,
+ 10704,
+ 10754,
+ 10805,
+ 10856,
+ 10907,
+ 10959,
+ 11010,
+ 11062,
+ 11113,
+ 11165,
+ 11217,
+ 11269,
+ 11321,
+ 11374,
+ 11426,
+ 11479,
+ 11532,
+ 11585,
+ 11638,
+ 11691,
+ 11745,
+ 11798,
+ 11852,
+ 11906,
+ 11959,
+ 12014,
+ 12068,
+ 12122,
+ 12177,
+ 12231,
+ 12286,
+ 12341,
+ 12396,
+ 12452,
+ 12507,
+ 12562,
+ 12618,
+ 12674,
+ 12730,
+ 12786,
+ 12842,
+ 12899,
+ 12955,
+ 13012,
+ 13069,
+ 13126,
+ 13183,
+ 13240,
+ 13297,
+ 13355,
+ 13413,
+ 13470,
+ 13528,
+ 13587,
+ 13645,
+ 13703,
+ 13762,
+ 13821,
+ 13879,
+ 13938,
+ 13998,
+ 14057,
+ 14116,
+ 14176,
+ 14236,
+ 14295,
+ 14356,
+ 14416,
+ 14476,
+ 14536,
+ 14597,
+ 14658,
+ 14719,
+ 14780,
+ 14841,
+ 14902,
+ 14964,
+ 15026,
+ 15087,
+ 15149,
+ 15211,
+ 15274,
+ 15336,
+ 15399,
+ 15461,
+ 15524,
+ 15587,
+ 15650,
+ 15713,
+ 15777,
+ 15840,
+ 15904,
+ 15968,
+ 16032,
+ 16096,
+ 16161,
+ 16225,
+ 16290,
+ 16354,
+ 16419,
+ 16484,
+ 16550,
+ 16615,
+ 16681,
+ 16746,
+ 16812,
+ 16878,
+ 16944,
+ 17010,
+ 17077,
+ 17143,
+ 17210,
+ 17277,
+ 17344,
+ 17411,
+ 17479,
+ 17546,
+ 17614,
+ 17682,
+ 17749,
+ 17818,
+ 17886,
+ 17954,
+ 18023,
+ 18091,
+ 18160,
+ 18229,
+ 18299,
+ 18368,
+ 18437,
+ 18507,
+ 18577,
+ 18647,
+ 18717,
+ 18787,
+ 18857,
+ 18928,
+ 18999,
+ 19069,
+ 19140,
+ 19212,
+ 19283,
+ 19354,
+ 19426,
+ 19498,
+ 19570,
+ 19642,
+ 19714,
+ 19786,
+ 19859,
+ 19932,
+ 20005,
+ 20078,
+ 20151,
+ 20224,
+ 20297,
+ 20371,
+ 20445,
+ 20519,
+ 20593,
+ 20667,
+ 20742,
+ 20816,
+ 20891,
+ 20966,
+ 21041,
+ 21116,
+ 21191,
+ 21267,
+ 21343,
+ 21418,
+ 21494,
+ 21570,
+ 21647,
+ 21723,
+ 21800,
+ 21877,
+ 21954,
+ 22031,
+ 22108,
+ 22185,
+ 22263,
+ 22340,
+ 22418,
+ 22496,
+ 22575,
+ 22653,
+ 22731,
+ 22810,
+ 22889,
+ 22968,
+ 23047,
+ 23126,
+ 23206,
+ 23285,
+ 23365,
+ 23445,
+ 23525,
+ 23605,
+ 23686,
+ 23766,
+ 23847,
+ 23928,
+ 24009,
+ 24090,
+ 24172,
+ 24253,
+ 24335,
+ 24417,
+ 24499,
+ 24581,
+ 24663,
+ 24746,
+ 24828,
+ 24911,
+ 24994,
+ 25077,
+ 25161,
+ 25244,
+ 25328,
+ 25411,
+ 25495,
+ 25579,
+ 25664,
+ 25748,
+ 25833,
+ 25917,
+ 26002,
+ 26087,
+ 26173,
+ 26258,
+ 26344,
+ 26429,
+ 26515,
+ 26601,
+ 26687,
+ 26774,
+ 26860,
+ 26947,
+ 27034,
+ 27121,
+ 27208,
+ 27295,
+ 27383,
+ 27471,
+ 27559,
+ 27647,
+ 27735,
+ 27823,
+ 27912,
+ 28000,
+ 28089,
+ 28178,
+ 28267,
+ 28356,
+ 28446,
+ 28536,
+ 28625,
+ 28715,
+ 28806,
+ 28896,
+ 28986,
+ 29077,
+ 29168,
+ 29259,
+ 29350,
+ 29441,
+ 29533,
+ 29624,
+ 29716,
+ 29808,
+ 29900,
+ 29992,
+ 30085,
+ 30177,
+ 30270,
+ 30363,
+ 30456,
+ 30550,
+ 30643,
+ 30737,
+ 30830,
+ 30924,
+ 31018,
+ 31113,
+ 31207,
+ 31302,
+ 31397,
+ 31492,
+ 31587,
+ 31682,
+ 31777,
+ 31873,
+ 31969,
+ 32065,
+ 32161,
+ 32257,
+ 32354,
+ 32450,
+ 32547,
+ 32644,
+ 32741,
+ 32839,
+ 32936,
+ 33034,
+ 33131,
+ 33229,
+ 33328,
+ 33426,
+ 33524,
+ 33623,
+ 33722,
+ 33821,
+ 33920,
+ 34019,
+ 34119,
+ 34219,
+ 34318,
+ 34418,
+ 34519,
+ 34619,
+ 34719,
+ 34820,
+ 34921,
+ 35022,
+ 35123,
+ 35225,
+ 35326,
+ 35428,
+ 35530,
+ 35632,
+ 35734,
+ 35836,
+ 35939,
+ 36042,
+ 36145,
+ 36248,
+ 36351,
+ 36454,
+ 36558,
+ 36662,
+ 36766,
+ 36870,
+ 36974,
+ 37078,
+ 37183,
+ 37288,
+ 37393,
+ 37498,
+ 37603,
+ 37709,
+ 37814,
+ 37920,
+ 38026,
+ 38132,
+ 38239,
+ 38345,
+ 38452,
+ 38559,
+ 38666,
+ 38773,
+ 38880,
+ 38988,
+ 39096,
+ 39204,
+ 39312,
+ 39420,
+ 39528,
+ 39637,
+ 39746,
+ 39855,
+ 39964,
+ 40073,
+ 40183,
+ 40292,
+ 40402,
+ 40512,
+ 40622,
+ 40733,
+ 40843,
+ 40954,
+ 41065,
+ 41176,
+ 41287,
+ 41398,
+ 41510,
+ 41622,
+ 41734,
+ 41846,
+ 41958,
+ 42070,
+ 42183,
+ 42296,
+ 42409,
+ 42522,
+ 42635,
+ 42749,
+ 42862,
+ 42976,
+ 43090,
+ 43204,
+ 43319,
+ 43433,
+ 43548,
+ 43663,
+ 43778,
+ 43893,
+ 44009,
+ 44124,
+ 44240,
+ 44356,
+ 44472,
+ 44589,
+ 44705,
+ 44822,
+ 44939,
+ 45056,
+ 45173,
+ 45290,
+ 45408,
+ 45526,
+ 45643,
+ 45762,
+ 45880,
+ 45998,
+ 46117,
+ 46236,
+ 46355,
+ 46474,
+ 46593,
+ 46713,
+ 46832,
+ 46952,
+ 47072,
+ 47193,
+ 47313,
+ 47434,
+ 47554,
+ 47675,
+ 47797,
+ 47918,
+ 48039,
+ 48161,
+ 48283,
+ 48405,
+ 48527,
+ 48650,
+ 48772,
+ 48895,
+ 49018,
+ 49141,
+ 49264,
+ 49388,
+ 49511,
+ 49635,
+ 49759,
+ 49883,
+ 50008,
+ 50132,
+ 50257,
+ 50382,
+ 50507,
+ 50632,
+ 50758,
+ 50883,
+ 51009,
+ 51135,
+ 51261,
+ 51388,
+ 51514,
+ 51641,
+ 51768,
+ 51895,
+ 52022,
+ 52150,
+ 52277,
+ 52405,
+ 52533,
+ 52661,
+ 52790,
+ 52918,
+ 53047,
+ 53176,
+ 53305,
+ 53434,
+ 53564,
+ 53694,
+ 53823,
+ 53953,
+ 54084,
+ 54214,
+ 54345,
+ 54475,
+ 54606,
+ 54737,
+ 54869,
+ 55000,
+ 55132,
+ 55264,
+ 55396,
+ 55528,
+ 55660,
+ 55793,
+ 55926,
+ 56059,
+ 56192,
+ 56325,
+ 56458,
+ 56592,
+ 56726,
+ 56860,
+ 56994,
+ 57129,
+ 57263,
+ 57398,
+ 57533,
+ 57668,
+ 57804,
+ 57939,
+ 58075,
+ 58211,
+ 58347,
+ 58483,
+ 58620,
+ 58756,
+ 58893,
+ 59030,
+ 59167,
+ 59305,
+ 59442,
+ 59580,
+ 59718,
+ 59856,
+ 59995,
+ 60133,
+ 60272,
+ 60411,
+ 60550,
+ 60689,
+ 60828,
+ 60968,
+ 61108,
+ 61248,
+ 61388,
+ 61528,
+ 61669,
+ 61810,
+ 61951,
+ 62092,
+ 62233,
+ 62375,
+ 62516,
+ 62658,
+ 62800,
+ 62942,
+ 63085,
+ 63227,
+ 63370,
+ 63513,
+ 63656,
+ 63800,
+ 63943,
+ 64087,
+ 64231,
+ 64375,
+ 64519,
+ 64664,
+ 64809,
+ 64954,
+ 65099,
+ 65244,
+ 65389,
+ 65535
+};
+
+static const guint ufraw_srgb_tone_curve_values_n = G_N_ELEMENTS (ufraw_srgb_tone_curve_values);
+
+#endif
+
+// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
+// vim: shiftwidth=2 expandtab tabstop=2 cindent
+// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-space on;
Binary files ufraw-cvs/test.icc and ufraw-dev/test.icc differ
diff -Nurpd ufraw-cvs/ufraw_conf.c ufraw-dev/ufraw_conf.c
--- ufraw-cvs/ufraw_conf.c 2014-01-01 07:00:23.000000000 +0100
+++ ufraw-dev/ufraw_conf.c 2014-01-24 19:36:14.931154177 +0100
@@ -70,7 +70,7 @@ const conf_data conf_default = {
2 , { { 0.0, 0.0 }, { 1.0, 1.0 } }
}
},
- { 1, 0, 0 } , { 2, 2, 2 }, /* profileIndex[], profileCount[] */
+ { 1, 0, 0 } , { 2, 3, 2 }, /* profileIndex[], profileCount[] */
/* Profile data defaults */
{ { { N_("No profile"), "", "", 0.45, 0.1, 0 },
{ N_("Color matrix"), "", "", 0.45, 0.1, 0 },
@@ -78,6 +78,7 @@ const conf_data conf_default = {
},
{ { N_("sRGB"), "", "", 0.0, 0.0, 8 },
{ N_("sRGB (embedded)"), "", "", 0.0, 0.0, 8 },
+ { N_("Adobe RGB (embedded)"), "", "", 0.0, 0.0, 8 },
{ "Some ICC Profile", "", "", 0.0, 0.0, 8 }
},
{ { N_("System default"), "", "", 0.0, 0.0, 0 },
@@ -1209,6 +1210,7 @@ int conf_save(conf_data *c, char *IDFile
if (j == in_profile && i == 1) profile = "Matrix";
if (j == out_profile && i == 0) profile = "sRGB";
if (j == out_profile && i == 1) profile = "sRGBEmbedded";
+ if (j == out_profile && i == 2) profile = "aRGBEmbedded";
if (j == display_profile && i == 0) profile = "System";
if (j == display_profile && i == 1) profile = "sRGB";
buf = uf_markup_buf(buf, "<%s%s Current='%s'>%s\n",
diff -Nurpd ufraw-cvs/ufraw_developer.c ufraw-dev/ufraw_developer.c
--- ufraw-cvs/ufraw_developer.c 2014-01-01 07:00:23.000000000 +0100
+++ ufraw-dev/ufraw_developer.c 2014-01-24 19:21:03.375173067 +0100
@@ -17,6 +17,7 @@
#include <math.h>
#include <string.h>
#ifdef HAVE_LCMS2
+#include "colorspaces.h"
#include <lcms2.h>
#include <lcms2_plugin.h>
#else
@@ -139,6 +140,7 @@ const char *cmsTakeProductName(cmsHPROFI
cmsGetProfileInfoASCII(profile, cmsInfoManufacturer,
"en", "US", manufacturer, max_name);
+
cmsGetProfileInfoASCII(profile, cmsInfoModel,
"en", "US", model, max_name);
@@ -168,14 +170,14 @@ void developer_profile(developer_data *d
g_strlcpy(d->profileFile[type], p->file, max_path);
if (d->profile[type] != NULL) cmsCloseProfile(d->profile[type]);
if (!strcmp(d->profileFile[type], ""))
- d->profile[type] = cmsCreate_sRGBProfile();
+ d->profile[type] = ufraw_colorspaces_create_srgb_profile();
else {
char *filename =
uf_win32_locale_filename_from_utf8(d->profileFile[type]);
d->profile[type] = cmsOpenProfileFromFile(filename, "r");
uf_win32_locale_filename_free(filename);
if (d->profile[type] == NULL)
- d->profile[type] = cmsCreate_sRGBProfile();
+ d->profile[type] = ufraw_colorspaces_create_srgb_profile();
}
d->updateTransform = TRUE;
}
@@ -197,7 +199,7 @@ void developer_display_profile(developer
d->profile[type] = cmsOpenProfileFromMem(profile, size);
// If embedded profile is invalid fall-back to sRGB
if (d->profile[type] == NULL)
- d->profile[type] = cmsCreate_sRGBProfile();
+ d->profile[type] = ufraw_colorspaces_create_srgb_profile();
if (strcmp(d->profileFile[type], embedded_display_profile) != 0) {
// start using embedded profile
g_strlcpy(d->profileFile[type], embedded_display_profile, max_path);
@@ -207,7 +209,7 @@ void developer_display_profile(developer
if (strcmp(d->profileFile[type], embedded_display_profile) == 0) {
// embedded profile is no longer used
if (d->profile[type] != NULL) cmsCloseProfile(d->profile[type]);
- d->profile[type] = cmsCreate_sRGBProfile();
+ d->profile[type] = ufraw_colorspaces_create_srgb_profile();
strcpy(d->profileFile[type], "");
d->updateTransform = TRUE;
}
diff -Nurpd ufraw-cvs/ufraw_preview.c ufraw-dev/ufraw_preview.c
--- ufraw-cvs/ufraw_preview.c 2014-01-01 07:00:23.000000000 +0100
+++ ufraw-dev/ufraw_preview.c 2014-01-24 18:17:01.795252665 +0100
@@ -5325,7 +5325,7 @@ static void save_fill_interface(preview_
#endif // HAVE_LIBJPEG
#if defined(HAVE_LIBTIFF) && defined(HAVE_LIBZ)
- button = uf_check_button_new(_("TIFF lossless Compress"),
+ button = uf_check_button_new(_("TIFF lossless compresssion (Deflate)"),
&CFG->losslessCompress);
gtk_box_pack_start(GTK_BOX(vBox), button, FALSE, FALSE, 0);
#endif // HAVE_LIBTIFF && HAVE_LIBZ
diff -Nurpd ufraw-cvs/ufraw_writer.c ufraw-dev/ufraw_writer.c
--- ufraw-cvs/ufraw_writer.c 2014-01-01 07:00:24.000000000 +0100
+++ ufraw-dev/ufraw_writer.c 2014-01-24 19:46:29.191141452 +0100
@@ -15,6 +15,7 @@
#include <errno.h> /* for errno */
#include <string.h>
#ifdef HAVE_LCMS2
+#include "colorspaces.h"
#include <lcms2.h>
#else
#include <lcms.h>
@@ -399,7 +400,17 @@ int ufraw_write_image(ufraw_data *uf)
? PHOTOMETRIC_MINISBLACK : PHOTOMETRIC_RGB);
#ifdef HAVE_LIBZ
if (uf->conf->losslessCompress) {
- TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE);
+
+ /* http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf (dated 2002)
+ * "A proprietary ZIP/Flate compression code (0x80b2) has been used by some"
+ * "software vendors. This code should be considered obsolete. We recommend"
+ * "that TIFF implentations recognize and read the obsolete code but only"
+ * "write the official compression code (0x0008)."
+ * http://www.awaresystems.be/imaging/tiff/tifftags/compression.html
+ * http://www.awaresystems.be/imaging/tiff/tifftags/predictor.html
+ */
+
+ TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_ADOBE_DEFLATE);
TIFFSetField(out, TIFFTAG_ZIPQUALITY, 9);
TIFFSetField(out, TIFFTAG_PREDICTOR, 2);
} else
@@ -420,7 +431,23 @@ int ufraw_write_image(ufraw_data *uf)
uf->conf->outputFilename);
}
} else if (uf->conf->profileIndex[out_profile] == 1) { // Embed sRGB.
- cmsHPROFILE hOutProfile = cmsCreate_sRGBProfile();
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_srgb_profile();
+ cmsUInt32Number len = 0;
+ cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
+ if (len > 0) {
+ unsigned char buf[len];
+ cmsSaveProfileToMem(hOutProfile, buf, &len);
+ TIFFSetField(out, TIFFTAG_ICCPROFILE, len, buf);
+ } else {
+ ufraw_set_warning(uf,
+ _("Failed to embed output profile '%s' in '%s'."),
+ uf->conf->profile[out_profile]
+ [uf->conf->profileIndex[out_profile]].name,
+ uf->conf->outputFilename);
+ }
+ cmsCloseProfile(hOutProfile);
+ } else if (uf->conf->profileIndex[out_profile] == 2) { // Embed aRGB.
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_adobergb_profile();
cmsUInt32Number len = 0;
cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
if (len > 0) {
@@ -493,7 +520,23 @@ int ufraw_write_image(ufraw_data *uf)
uf->conf->outputFilename);
}
} else if (uf->conf->profileIndex[out_profile] == 1) { // Embed sRGB.
- cmsHPROFILE hOutProfile = cmsCreate_sRGBProfile();
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_srgb_profile();
+ cmsUInt32Number len = 0;
+ cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
+ if (len > 0) {
+ unsigned char buf[len];
+ cmsSaveProfileToMem(hOutProfile, buf, &len);
+ write_icc_profile(&cinfo, buf, len);
+ } else {
+ ufraw_set_warning(uf,
+ _("Failed to embed output profile '%s' in '%s'."),
+ uf->conf->profile[out_profile]
+ [uf->conf->profileIndex[out_profile]].name,
+ uf->conf->outputFilename);
+ }
+ cmsCloseProfile(hOutProfile);
+ } else if (uf->conf->profileIndex[out_profile] == 2) { // Embed aRGB.
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_adobergb_profile();
cmsUInt32Number len = 0;
cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
if (len > 0) {
@@ -585,7 +628,27 @@ int ufraw_write_image(ufraw_data *uf)
uf->conf->outputFilename);
}
} else if (uf->conf->profileIndex[out_profile] == 1) { // Embed sRGB.
- cmsHPROFILE hOutProfile = cmsCreate_sRGBProfile();
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_srgb_profile();
+ cmsUInt32Number len = 0;
+ cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
+ if (len > 0) {
+ char buf[len];
+ cmsSaveProfileToMem(hOutProfile, buf, &len);
+ png_set_iCCP(png, info,
+ uf->conf->profile[out_profile]
+ [uf->conf->profileIndex[out_profile]].name,
+ PNG_COMPRESSION_TYPE_BASE,
+ (png_const_bytep) buf, len);
+ } else {
+ ufraw_set_warning(uf,
+ _("Failed to embed output profile '%s' in '%s'."),
+ uf->conf->profile[out_profile]
+ [uf->conf->profileIndex[out_profile]].name,
+ uf->conf->outputFilename);
+ }
+ cmsCloseProfile(hOutProfile);
+ } else if (uf->conf->profileIndex[out_profile] == 1) { // Embed aRGB.
+ cmsHPROFILE hOutProfile = ufraw_colorspaces_create_adobergb_profile();
cmsUInt32Number len = 0;
cmsSaveProfileToMem(hOutProfile, 0, &len); // Calculate len.
if (len > 0) {
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
ufraw-devel mailing list
ufraw-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ufraw-devel