Author: post
Date: 2010-05-06 22:33:17 +0200 (Thu, 06 May 2010)
New Revision: 3365

Modified:
   trunk/plugins/colorspace-adobergb/colorspace-adobergb.c
   trunk/plugins/colorspace-prophoto/colorspace-prophoto.c
   trunk/plugins/colorspace-srgb/colorspace-srgb.c
   trunk/plugins/output-pngfile/output-pngfile.c
   trunk/plugins/output-tifffile/output-tifffile.c
   trunk/profiles/Makefile.am
Log:
Add linear profiles, and add them when exporting 16 bit TIFF/PNG. Tested with 
PNG and Photoshop/GIMP.

Modified: trunk/plugins/colorspace-adobergb/colorspace-adobergb.c
===================================================================
--- trunk/plugins/colorspace-adobergb/colorspace-adobergb.c     2010-05-06 
19:58:57 UTC (rev 3364)
+++ trunk/plugins/colorspace-adobergb/colorspace-adobergb.c     2010-05-06 
20:33:17 UTC (rev 3365)
@@ -37,6 +37,7 @@
        RSColorSpaceClass parent_class;
 
        const RSIccProfile *icc_profile;
+       const RSIccProfile *icc_profile_linear;
 } RSAdobeRGBClass;
 
 RS_DEFINE_COLOR_SPACE(rs_adobe_rgb, RSAdobeRGB)
@@ -59,6 +60,7 @@
        colorclass->description = _("Print friendly color space, compatible 
with Adobe RGB (1998)");
 
        klass->icc_profile = rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" 
PACKAGE "/profiles/compatibleWithAdobeRGB1998.icc");
+       klass->icc_profile_linear = 
rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" PACKAGE 
"/profiles/compatibleWithAdobeRGB1998-linear.icc");
 }
 
 static void
@@ -80,5 +82,8 @@
 {
        RSAdobeRGB *adobe_rgb = RS_ADOBERGB(color_space);
 
-       return RS_ADOBERGB_GET_CLASS(adobe_rgb)->icc_profile;
+       if (linear_profile)
+               return RS_ADOBERGB_GET_CLASS(adobe_rgb)->icc_profile_linear;
+       else
+               return RS_ADOBERGB_GET_CLASS(adobe_rgb)->icc_profile;
 }

Modified: trunk/plugins/colorspace-prophoto/colorspace-prophoto.c
===================================================================
--- trunk/plugins/colorspace-prophoto/colorspace-prophoto.c     2010-05-06 
19:58:57 UTC (rev 3364)
+++ trunk/plugins/colorspace-prophoto/colorspace-prophoto.c     2010-05-06 
20:33:17 UTC (rev 3365)
@@ -37,6 +37,7 @@
        RSColorSpaceClass parent_class;
 
        const RSIccProfile *icc_profile;
+       const RSIccProfile *icc_profile_linear;
 } RSProphotoClass;
 
 RS_DEFINE_COLOR_SPACE(rs_prophoto, RSProphoto)
@@ -59,6 +60,7 @@
        colorclass->description = _("Large gamut color space");
 
        klass->icc_profile = rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" 
PACKAGE "/profiles/prophoto.icc");
+       klass->icc_profile_linear = 
rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" PACKAGE 
"/profiles/prophoto-linear.icc");
 }
 
 static void
@@ -79,5 +81,8 @@
 {
        RSProphoto *prophoto = RS_PROPHOTO(color_space);
 
-       return RS_PROPHOTO_GET_CLASS(prophoto)->icc_profile;
+       if (linear_profile)
+               return RS_PROPHOTO_GET_CLASS(prophoto)->icc_profile_linear;
+       else
+               return RS_PROPHOTO_GET_CLASS(prophoto)->icc_profile;
 }

Modified: trunk/plugins/colorspace-srgb/colorspace-srgb.c
===================================================================
--- trunk/plugins/colorspace-srgb/colorspace-srgb.c     2010-05-06 19:58:57 UTC 
(rev 3364)
+++ trunk/plugins/colorspace-srgb/colorspace-srgb.c     2010-05-06 20:33:17 UTC 
(rev 3365)
@@ -38,6 +38,7 @@
        RSColorSpaceClass parent_class;
 
        RSIccProfile *icc_profile;
+       RSIccProfile *icc_profile_linear;
 } RSSrgbClass;
 
 RS_DEFINE_COLOR_SPACE(rs_srgb, RSSrgb)
@@ -63,7 +64,7 @@
        colorclass->get_gamma_function = get_gamma_function;
 
        klass->icc_profile = rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" 
PACKAGE "/profiles/sRGB.icc");
-
+       klass->icc_profile_linear = 
rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" PACKAGE 
"/profiles/sRGB-linear.icc");
 }
 
 static void
@@ -84,7 +85,10 @@
 {
        RSSrgb *srgb = RS_SRGB(color_space);
 
-       return RS_SRGB_GET_CLASS(srgb)->icc_profile;
+       if (linear_profile)
+               return RS_SRGB_GET_CLASS(srgb)->icc_profile_linear;
+       else
+               return RS_SRGB_GET_CLASS(srgb)->icc_profile;
 }
 
 /* Gamma */

Modified: trunk/plugins/output-pngfile/output-pngfile.c
===================================================================
--- trunk/plugins/output-pngfile/output-pngfile.c       2010-05-06 19:58:57 UTC 
(rev 3364)
+++ trunk/plugins/output-pngfile/output-pngfile.c       2010-05-06 20:33:17 UTC 
(rev 3365)
@@ -172,11 +172,9 @@
        png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION);
 
 
-       if (pngfile->color_space == rs_color_space_new_singleton("RSSrgb"))
+       if (pngfile->color_space == rs_color_space_new_singleton("RSSrgb") && 
!pngfile->save16bit)
        {
                png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, 
PNG_sRGB_INTENT_PERCEPTUAL);
-               if (pngfile->save16bit)
-                       png_set_gAMA(png_ptr, info_ptr, 1.0);
        }
        else
        {

Modified: trunk/plugins/output-tifffile/output-tifffile.c
===================================================================
--- trunk/plugins/output-tifffile/output-tifffile.c     2010-05-06 19:58:57 UTC 
(rev 3364)
+++ trunk/plugins/output-tifffile/output-tifffile.c     2010-05-06 20:33:17 UTC 
(rev 3365)
@@ -206,7 +206,7 @@
        if((tiff = TIFFOpen(tifffile->filename, "w")) == NULL)
                return(FALSE);
 
-       if (tifffile->color_space && 
!g_str_equal(G_OBJECT_TYPE_NAME(tifffile->color_space), "RSSrgb"))
+       if (tifffile->color_space && 
(!g_str_equal(G_OBJECT_TYPE_NAME(tifffile->color_space), "RSSrgb") || 
tifffile->save16bit))
                profile = rs_color_space_get_icc_profile(tifffile->color_space, 
tifffile->save16bit);
 
        RSFilterRequest *request = rs_filter_request_new();

Modified: trunk/profiles/Makefile.am
===================================================================
--- trunk/profiles/Makefile.am  2010-05-06 19:58:57 UTC (rev 3364)
+++ trunk/profiles/Makefile.am  2010-05-06 20:33:17 UTC (rev 3365)
@@ -1,8 +1,12 @@
 rawstudiodir = $(datadir)/rawstudio/profiles
 rawstudio_DATA = rawstudio-cameras.xml\
        generic_camera_profile.icc\
-       sRGB.icc prophoto.icc\
+       sRGB.icc\
+       prophoto.icc\
        compatibleWithAdobeRGB1998.icc\
+       sRGB-linear.icc\
+       prophoto-linear.icc\
+       compatibleWithAdobeRGB1998-linear.icc\
        Neutral-With-Tonecurve-sRGB.dcp\
        Neutral-With-Tonecurve-AdobeRGB.dcp\
        Neutral-With-Tonecurve-Prophoto.dcp\


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to