annotate src/color-man.c @ 1686:59c72fd324ce

fixes for a built without Exiv2 don't try to access XMP metadata if not compiled with Exiv2 some metadata options are valid without Exiv2, do not disable them
author nadvornik
date Tue, 30 Jun 2009 20:12:28 +0000
parents 7302ff300a52
children 956aab097ea7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 115
diff changeset
2 * Geeqie
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
3 * (C) 2006 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1055
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
5 *
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
6 * Author: John Ellis
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
7 *
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
11 */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
12
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
13
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 196
diff changeset
14 #include "main.h"
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
15 #include "color-man.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
16
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
17 #include "image.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
18 #include "ui_fileops.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
19
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
20
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
21 #ifdef HAVE_LCMS
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
22 /*** color support enabled ***/
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
23
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 671
diff changeset
24 #include <lcms.h>
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
25
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
26
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
27 typedef struct _ColorManCache ColorManCache;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
28 struct _ColorManCache {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
29 cmsHPROFILE profile_in;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
30 cmsHPROFILE profile_out;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
31 cmsHTRANSFORM transform;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
32
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
33 ColorManProfileType profile_in_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
34 gchar *profile_in_file;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
35
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
36 ColorManProfileType profile_out_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
37 gchar *profile_out_file;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
38
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
39 gboolean has_alpha;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
40
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
41 gint refcount;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
42 };
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
43
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
44 /* pixels to transform per idle call */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
45 #define COLOR_MAN_CHUNK_SIZE 81900
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
46
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
47
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48 static void color_man_lib_init(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
49 {
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
50 static gboolean init_done = FALSE;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
51
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
52 if (init_done) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
53 init_done = TRUE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
54
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
55 cmsErrorAction(LCMS_ERROR_IGNORE);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
56 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
57
609
b690cecbf5b8 Use function(void) instead of function() for declaring functions which
zas_
parents: 507
diff changeset
58 static cmsHPROFILE color_man_create_adobe_comp(void)
424
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
59 {
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
60 /* ClayRGB1998 is AdobeRGB compatible */
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
61 #include "ClayRGB1998_icc.h"
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
62 return cmsOpenProfileFromMem(ClayRGB1998_icc, ClayRGB1998_icc_len);
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
63 }
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
64
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
65 /*
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
66 *-------------------------------------------------------------------
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
67 * color transform cache
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
68 *-------------------------------------------------------------------
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
69 */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
70
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
71 static GList *cm_cache_list = NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
72
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
73
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
74 static void color_man_cache_ref(ColorManCache *cc)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
75 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
76 if (!cc) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
77
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
78 cc->refcount++;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
79 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
80
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
81 static void color_man_cache_unref(ColorManCache *cc)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
82 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
83 if (!cc) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
84
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
85 cc->refcount--;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
86 if (cc->refcount < 1)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
87 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
88 if (cc->transform) cmsDeleteTransform(cc->transform);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
89 if (cc->profile_in) cmsCloseProfile(cc->profile_in);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
90 if (cc->profile_out) cmsCloseProfile(cc->profile_out);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
91
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
92 g_free(cc->profile_in_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
93 g_free(cc->profile_out_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
94
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
95 g_free(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
96 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
97 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
98
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
99 static cmsHPROFILE color_man_cache_load_profile(ColorManProfileType type, const gchar *file,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
100 guchar *data, guint data_len)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
101 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
102 cmsHPROFILE profile = NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
103
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
104 switch (type)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
105 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
106 case COLOR_PROFILE_FILE:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
107 if (file)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
108 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
109 gchar *pathl;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
110
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
111 pathl = path_from_utf8(file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
112 profile = cmsOpenProfileFromFile(pathl, "r");
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
113 g_free(pathl);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
114 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
115 break;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
116 case COLOR_PROFILE_SRGB:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
117 profile = cmsCreate_sRGBProfile();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
118 break;
424
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
119 case COLOR_PROFILE_ADOBERGB:
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
120 profile = color_man_create_adobe_comp();
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
121 break;
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
122 case COLOR_PROFILE_MEM:
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
123 if (data)
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
124 {
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
125 profile = cmsOpenProfileFromMem(data, data_len);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
126 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
127 break;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
128 case COLOR_PROFILE_NONE:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
129 default:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
130 break;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
131 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
132
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
133 return profile;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
134 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
135
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
136 static ColorManCache *color_man_cache_new(ColorManProfileType in_type, const gchar *in_file,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
137 guchar *in_data, guint in_data_len,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
138 ColorManProfileType out_type, const gchar *out_file,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
139 guchar *out_data, guint out_data_len,
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
140 gboolean has_alpha)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
141 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
142 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
143
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
144 color_man_lib_init();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
145
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
146 cc = g_new0(ColorManCache, 1);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
147 cc->refcount = 1;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
148
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
149 cc->profile_in_type = in_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
150 cc->profile_in_file = g_strdup(in_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
151
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
152 cc->profile_out_type = out_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
153 cc->profile_out_file = g_strdup(out_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
154
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
155 cc->has_alpha = has_alpha;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
156
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
157 cc->profile_in = color_man_cache_load_profile(cc->profile_in_type, cc->profile_in_file,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
158 in_data, in_data_len);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
159 cc->profile_out = color_man_cache_load_profile(cc->profile_out_type, cc->profile_out_file,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
160 out_data, out_data_len);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
161
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
162 if (!cc->profile_in || !cc->profile_out)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
163 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 495
diff changeset
164 DEBUG_1("failed to load color profile for %s: %d %s",
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
165 (!cc->profile_in) ? "input" : "screen",
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
166 (!cc->profile_in) ? cc->profile_in_type : cc->profile_out_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
167 (!cc->profile_in) ? cc->profile_in_file : cc->profile_out_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
168
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
169 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
170 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
171 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
172
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
173 cc->transform = cmsCreateTransform(cc->profile_in,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
174 (has_alpha) ? TYPE_RGBA_8 : TYPE_RGB_8,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
175 cc->profile_out,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
176 (has_alpha) ? TYPE_RGBA_8 : TYPE_RGB_8,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
177 INTENT_PERCEPTUAL, 0);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
178
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
179 if (!cc->transform)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
180 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 495
diff changeset
181 DEBUG_1("failed to create color profile transform");
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
182
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
183 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
184 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
185 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
186
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
187 if (cc->profile_in_type != COLOR_PROFILE_MEM && cc->profile_out_type != COLOR_PROFILE_MEM )
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
188 {
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
189 cm_cache_list = g_list_append(cm_cache_list, cc);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
190 color_man_cache_ref(cc);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
191 }
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
192
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
193 return cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
194 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
195
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
196 static void color_man_cache_free(ColorManCache *cc)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
197 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
198 if (!cc) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
199
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
200 cm_cache_list = g_list_remove(cm_cache_list, cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
201 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
202 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
203
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
204 static void color_man_cache_reset(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
205 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
206 while (cm_cache_list)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
207 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
208 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
209
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
210 cc = cm_cache_list->data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
211 color_man_cache_free(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
212 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
213 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
214
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
215 static ColorManCache *color_man_cache_find(ColorManProfileType in_type, const gchar *in_file,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
216 ColorManProfileType out_type, const gchar *out_file,
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
217 gboolean has_alpha)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
218 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
219 GList *work;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
220
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
221 work = cm_cache_list;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
222 while (work)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
223 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
224 ColorManCache *cc;
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
225 gboolean match = FALSE;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
226
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
227 cc = work->data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
228 work = work->next;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
229
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
230 if (cc->profile_in_type == in_type &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
231 cc->profile_out_type == out_type &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
232 cc->has_alpha == has_alpha)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
233 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
234 match = TRUE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
235 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
236
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
237 if (match && cc->profile_in_type == COLOR_PROFILE_FILE)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
238 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
239 match = (cc->profile_in_file && in_file &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
240 strcmp(cc->profile_in_file, in_file) == 0);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
241 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
242 if (match && cc->profile_out_type == COLOR_PROFILE_FILE)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
243 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
244 match = (cc->profile_out_file && out_file &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
245 strcmp(cc->profile_out_file, out_file) == 0);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
246 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
247
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
248 if (match) return cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
249 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
250
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
251 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
252 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
253
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
254 static ColorManCache *color_man_cache_get(ColorManProfileType in_type, const gchar *in_file,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
255 guchar *in_data, guint in_data_len,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
256 ColorManProfileType out_type, const gchar *out_file,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
257 guchar *out_data, guint out_data_len,
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
258 gboolean has_alpha)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
259 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
260 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
261
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
262 cc = color_man_cache_find(in_type, in_file, out_type, out_file, has_alpha);
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
263 if (cc)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
264 {
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
265 color_man_cache_ref(cc);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
266 return cc;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
267 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
268
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
269 return color_man_cache_new(in_type, in_file, in_data, in_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
270 out_type, out_file, out_data, out_data_len, has_alpha);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
271 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
272
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
273
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
274 /*
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
275 *-------------------------------------------------------------------
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
276 * color manager
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
277 *-------------------------------------------------------------------
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
278 */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
279
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
280 static void color_man_done(ColorMan *cm, ColorManReturnType type)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
281 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
282 if (cm->func_done)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
283 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
284 cm->func_done(cm, type, cm->func_done_data);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
285 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
286 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
287
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
288 void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
289 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
290 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
291 guchar *pix;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
292 gint rs;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
293 gint i;
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
294 gint pixbuf_width, pixbuf_height;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 424
diff changeset
295
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
296
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
297 pixbuf_width = gdk_pixbuf_get_width(pixbuf);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
298 pixbuf_height = gdk_pixbuf_get_height(pixbuf);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
299
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
300 cc = cm->profile;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
301
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
302 pix = gdk_pixbuf_get_pixels(pixbuf);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
303 rs = gdk_pixbuf_get_rowstride(pixbuf);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
304
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
305 w = MIN(w, pixbuf_width - x);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
306 h = MIN(h, pixbuf_height - y);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
307
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
308 pix += x * ((cc->has_alpha) ? 4 : 3);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
309 for (i = 0; i < h; i++)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
310 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
311 guchar *pbuf;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
312
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
313 pbuf = pix + ((y + i) * rs);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 424
diff changeset
314
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
315 cmsDoTransform(cc->transform, pbuf, pbuf, w);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
316 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
317
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
318 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
319
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
320 static gboolean color_man_idle_cb(gpointer data)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
321 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
322 ColorMan *cm = data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
323 gint width, height;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
324 gint rh;
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
325
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
326 if (!cm->pixbuf) return FALSE;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
327
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
328 if (cm->imd &&
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
329 cm->pixbuf != image_get_pixbuf(cm->imd))
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
330 {
1523
24a12aa0cb54 Fix up event source ids type: gint -> guint.
zas_
parents: 1420
diff changeset
331 cm->idle_id = 0;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
332 color_man_done(cm, COLOR_RETURN_IMAGE_CHANGED);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
333 return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
334 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
335
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
336 width = gdk_pixbuf_get_width(cm->pixbuf);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
337 height = gdk_pixbuf_get_height(cm->pixbuf);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
338
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
339 if (cm->row > height)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
340 {
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
341 if (!cm->incremental_sync && cm->imd)
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
342 {
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
343 image_area_changed(cm->imd, 0, 0, width, height);
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
344 }
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
345
1523
24a12aa0cb54 Fix up event source ids type: gint -> guint.
zas_
parents: 1420
diff changeset
346 cm->idle_id = 0;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
347 color_man_done(cm, COLOR_RETURN_SUCCESS);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
348 return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
349 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
350
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
351 rh = COLOR_MAN_CHUNK_SIZE / width + 1;
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
352 color_man_correct_region(cm, cm->pixbuf, 0, cm->row, width, rh);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
353 if (cm->incremental_sync && cm->imd) image_area_changed(cm->imd, 0, cm->row, width, rh);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
354 cm->row += rh;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
355
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
356 return TRUE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
357 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
358
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
359 static ColorMan *color_man_new_real(ImageWindow *imd, GdkPixbuf *pixbuf,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
360 ColorManProfileType input_type, const gchar *input_file,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
361 guchar *input_data, guint input_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
362 ColorManProfileType screen_type, const gchar *screen_file,
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
363 guchar *screen_data, guint screen_data_len)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
364 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
365 ColorMan *cm;
1420
3a9fb1b52559 Use gboolean where applicable, for the sake of consistency.
zas_
parents: 1284
diff changeset
366 gboolean has_alpha;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
367
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
368 if (imd) pixbuf = image_get_pixbuf(imd);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
369
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
370 cm = g_new0(ColorMan, 1);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
371 cm->imd = imd;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
372 cm->pixbuf = pixbuf;
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
373 if (cm->pixbuf) g_object_ref(cm->pixbuf);
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
374
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
375 has_alpha = pixbuf ? gdk_pixbuf_get_has_alpha(pixbuf) : FALSE;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
376
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
377 cm->profile = color_man_cache_get(input_type, input_file, input_data, input_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
378 screen_type, screen_file, screen_data, screen_data_len, has_alpha);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
379 if (!cm->profile)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
380 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
381 color_man_free(cm);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
382 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
383 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
384
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
385 return cm;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
386 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
387
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
388 ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
389 ColorManProfileType input_type, const gchar *input_file,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
390 ColorManProfileType screen_type, const gchar *screen_file,
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
391 guchar *screen_data, guint screen_data_len)
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
392 {
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
393 return color_man_new_real(imd, pixbuf,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
394 input_type, input_file, NULL, 0,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
395 screen_type, screen_file, screen_data, screen_data_len);
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
396 }
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
397
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
398 void color_man_start_bg(ColorMan *cm, ColorManDoneFunc done_func, gpointer done_data)
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
399 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
400 cm->func_done = done_func;
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
401 cm->func_done_data = done_data;
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
402 cm->idle_id = g_idle_add(color_man_idle_cb, cm);
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
403 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
404
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
405 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
406 guchar *input_data, guint input_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
407 ColorManProfileType screen_type, const gchar *screen_file,
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
408 guchar *screen_data, guint screen_data_len)
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
409 {
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
410 return color_man_new_real(imd, pixbuf,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
411 COLOR_PROFILE_MEM, NULL, input_data, input_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
412 screen_type, screen_file, screen_data, screen_data_len);
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
413 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
414
1549
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
415 static gchar *color_man_get_profile_name(ColorManProfileType type, cmsHPROFILE profile)
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
416 {
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
417 switch (type)
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
418 {
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
419 case COLOR_PROFILE_SRGB:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
420 return g_strdup(_("sRGB"));
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
421 case COLOR_PROFILE_ADOBERGB:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
422 return g_strdup(_("Adobe RGB compatible"));
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
423 break;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
424 case COLOR_PROFILE_MEM:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
425 case COLOR_PROFILE_FILE:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
426 if (profile)
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
427 {
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
428 return g_strdup(cmsTakeProductName(profile));
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
429 }
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
430 return g_strdup(_("Custom profile"));
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
431 break;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
432 case COLOR_PROFILE_NONE:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
433 default:
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
434 return g_strdup("");
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
435 }
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
436 }
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
437
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
438 gboolean color_man_get_status(ColorMan *cm, gchar **image_profile, gchar **screen_profile)
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
439 {
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
440 ColorManCache *cc;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
441 if (!cm) return FALSE;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
442
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
443 cc = cm->profile;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
444
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
445 if (image_profile) *image_profile = color_man_get_profile_name(cc->profile_in_type, cc->profile_in);
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
446 if (screen_profile) *screen_profile = color_man_get_profile_name(cc->profile_out_type, cc->profile_out);
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
447 return TRUE;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
448 }
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
449
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
450 void color_man_free(ColorMan *cm)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
451 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
452 if (!cm) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
453
1523
24a12aa0cb54 Fix up event source ids type: gint -> guint.
zas_
parents: 1420
diff changeset
454 if (cm->idle_id) g_source_remove(cm->idle_id);
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
455 if (cm->pixbuf) g_object_unref(cm->pixbuf);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
456
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
457 color_man_cache_unref(cm->profile);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
458
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
459 g_free(cm);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
460 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
461
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
462 void color_man_update(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
463 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
464 color_man_cache_reset();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
465 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
466
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 671
diff changeset
467 #else /* define HAVE_LCMS */
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
468 /*** color support not enabled ***/
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
469
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
470
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
471 ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
472 ColorManProfileType input_type, const gchar *input_file,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
473 ColorManProfileType screen_type, const gchar *screen_file,
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
474 guchar *screen_data, guint screen_data_len)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
475 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
476 /* no op */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
477 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
478 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
479
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
480 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
1000
4fe8f9656107 For the sake of consistency, use glib basic types everywhere.
zas_
parents: 686
diff changeset
481 guchar *input_data, guint input_data_len,
1548
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
482 ColorManProfileType screen_type, const gchar *screen_file,
b5608391f479 support X11 screen profile
nadvornik
parents: 1523
diff changeset
483 guchar *screen_data, guint screen_data_len)
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
484 {
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
485 /* no op */
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
486 return NULL;
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
487 }
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
488
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
489 void color_man_free(ColorMan *cm)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
490 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
491 /* no op */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
492 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
493
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
494 void color_man_update(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
495 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
496 /* no op */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
497 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
498
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
499 void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h)
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
500 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
501 /* no op */
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
502 }
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
503
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
504 void color_man_start_bg(ColorMan *cm, ColorManDoneFunc done_func, gpointer done_data)
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
505 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
506 /* no op */
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
507 }
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
508
1549
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
509 gboolean color_man_get_status(ColorMan *cm, gchar **image_profile, gchar **screen_profile)
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
510 {
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
511 return FALSE;
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
512 }
7302ff300a52 show color management status on statusbar
nadvornik
parents: 1548
diff changeset
513
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 671
diff changeset
514 #endif /* define HAVE_LCMS */
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1000
diff changeset
515 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */