annotate src/color-man.c @ 442:4b2d7f9af171

Big whitespaces cleanup: - drop whitespaces at end of lines - convert eight spaces to tab at start of lines - drop spurious spaces mixed with tabs - remove empty lines at end of files
author zas_
date Sun, 20 Apr 2008 13:04:57 +0000
parents 26c6e768bd47
children ddabc4873a3f
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
4 *
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
5 * Author: John Ellis
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
6 *
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
7 * 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
8 * 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
9 * 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
10 */
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
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 196
diff changeset
13 #include "main.h"
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
14 #include "color-man.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
15
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
16 #include "image.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
17 #include "ui_fileops.h"
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
18
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 #ifdef HAVE_LCMS
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
21 /*** color support enabled ***/
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
22
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
23 #ifdef HAVE_LCMS_LCMS_H
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
24 #include <lcms/lcms.h>
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
25 #else
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
26 #include <lcms.h>
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
27 #endif
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
28
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
29
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
30 typedef struct _ColorManCache ColorManCache;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
31 struct _ColorManCache {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
32 cmsHPROFILE profile_in;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
33 cmsHPROFILE profile_out;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
34 cmsHTRANSFORM transform;
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_in_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
37 gchar *profile_in_file;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
38
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
39 ColorManProfileType profile_out_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
40 gchar *profile_out_file;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
41
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
42 gint has_alpha;
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 gint refcount;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
45 };
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 /* pixels to transform per idle call */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48 #define COLOR_MAN_CHUNK_SIZE 81900
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
49
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
50
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
51 static void color_man_lib_init(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
52 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
53 static gint init_done = FALSE;
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 if (init_done) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
56 init_done = TRUE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
57
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
58 cmsErrorAction(LCMS_ERROR_IGNORE);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
59 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
60
424
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
61 static cmsHPROFILE color_man_create_adobe_comp()
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
62 {
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
63 /* ClayRGB1998 is AdobeRGB compatible */
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
64 #include "ClayRGB1998_icc.h"
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
65 return cmsOpenProfileFromMem(ClayRGB1998_icc, ClayRGB1998_icc_len);
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
66 }
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
67
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 * color transform cache
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
71 *-------------------------------------------------------------------
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 GList *cm_cache_list = NULL;
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
77 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
78 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
79 if (!cc) return;
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 cc->refcount++;
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
84 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
85 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
86 if (!cc) return;
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 cc->refcount--;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
89 if (cc->refcount < 1)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
90 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
91 if (cc->transform) cmsDeleteTransform(cc->transform);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
92 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
93 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
94
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
95 g_free(cc->profile_in_file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
96 g_free(cc->profile_out_file);
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 g_free(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
99 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
100 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
101
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
102 static cmsHPROFILE color_man_cache_load_profile(ColorManProfileType type, const gchar *file,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
103 unsigned char *data, guint data_len)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
104 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
105 cmsHPROFILE profile = NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
106
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
107 switch (type)
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 case COLOR_PROFILE_FILE:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
110 if (file)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
111 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
112 gchar *pathl;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
114 pathl = path_from_utf8(file);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
115 profile = cmsOpenProfileFromFile(pathl, "r");
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
116 g_free(pathl);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
117 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
118 break;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
119 case COLOR_PROFILE_SRGB:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
120 profile = cmsCreate_sRGBProfile();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
121 break;
424
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
122 case COLOR_PROFILE_ADOBERGB:
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
123 profile = color_man_create_adobe_comp();
26c6e768bd47 first support for AdobeRGB colorspace
nadvornik
parents: 398
diff changeset
124 break;
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
125 case COLOR_PROFILE_MEM:
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
126 if (data)
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
127 {
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
128 profile = cmsOpenProfileFromMem(data, data_len);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
129 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
130 break;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
131 case COLOR_PROFILE_NONE:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
132 default:
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
133 break;
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 return profile;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
137 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
138
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
139 static ColorManCache *color_man_cache_new(ColorManProfileType in_type, const gchar *in_file,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
140 unsigned char *in_data, guint in_data_len,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
141 ColorManProfileType out_type, const gchar *out_file,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
142 gint has_alpha)
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 ColorManCache *cc;
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 color_man_lib_init();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
147
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
148 cc = g_new0(ColorManCache, 1);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
149 cc->refcount = 1;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
150
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
151 cc->profile_in_type = in_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
152 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
153
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
154 cc->profile_out_type = out_type;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
155 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
156
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
157 cc->has_alpha = has_alpha;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
158
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
159 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
160 in_data, in_data_len);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
161 cc->profile_out = color_man_cache_load_profile(cc->profile_out_type, cc->profile_out_file,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
162 NULL, 0);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
163
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
164 if (!cc->profile_in || !cc->profile_out)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
165 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
166 if (debug) printf("failed to load color profile for %s: %d %s\n",
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
167 (!cc->profile_in) ? "input" : "screen",
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
168 (!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
169 (!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
170
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
171 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
172 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
173 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
174
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
175 cc->transform = cmsCreateTransform(cc->profile_in,
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 cc->profile_out,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
178 (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
179 INTENT_PERCEPTUAL, 0);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
180
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
181 if (!cc->transform)
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 if (debug) printf("failed to create color profile transform\n");
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
184
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
185 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
186 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
187 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
188
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
189 if (cc->profile_in_type != COLOR_PROFILE_MEM)
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
190 {
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
191 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
192 color_man_cache_ref(cc);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
193 }
113
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 return cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
196 }
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 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
199 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
200 if (!cc) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
201
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
202 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
203 color_man_cache_unref(cc);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
204 }
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 static void color_man_cache_reset(void)
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 while (cm_cache_list)
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 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
211
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
212 cc = cm_cache_list->data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
213 color_man_cache_free(cc);
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 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
216
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
217 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
218 ColorManProfileType out_type, const gchar *out_file,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
219 gint has_alpha)
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 GList *work;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
222
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
223 work = cm_cache_list;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
224 while (work)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
225 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
226 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
227 gint match = FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
228
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
229 cc = work->data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
230 work = work->next;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
231
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
232 if (cc->profile_in_type == in_type &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
233 cc->profile_out_type == out_type &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
234 cc->has_alpha == has_alpha)
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 match = TRUE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
237 }
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 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
240 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
241 match = (cc->profile_in_file && in_file &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
242 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
243 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
244 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
245 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
246 match = (cc->profile_out_file && out_file &&
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
247 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
248 }
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 if (match) return cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
251 }
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 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
254 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
255
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
256 static ColorManCache *color_man_cache_get(ColorManProfileType in_type, const gchar *in_file,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
257 unsigned char *in_data, guint in_data_len,
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
258 ColorManProfileType out_type, const gchar *out_file,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
259 gint has_alpha)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
260 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
261 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
262
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
263 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
264 if (cc)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
265 {
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
266 color_man_cache_ref(cc);
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
267 return cc;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
268 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
269
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
270 return color_man_cache_new(in_type, in_file, in_data, in_data_len,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
271 out_type, out_file, has_alpha);
113
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 *-------------------------------------------------------------------
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
277 * color manager
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
281 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
282 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
283 if (cm->func_done)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
284 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
285 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
286 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
287 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
288
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
289 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
290 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
291 ColorManCache *cc;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
292 guchar *pix;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
293 gint rs;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
294 gint i;
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
295 gint pixbuf_width, pixbuf_height;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 424
diff changeset
296
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
297
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
298 pixbuf_width = gdk_pixbuf_get_width(pixbuf);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
299 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
300
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
301 cc = cm->profile;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
302
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
303 pix = gdk_pixbuf_get_pixels(pixbuf);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
304 rs = gdk_pixbuf_get_rowstride(pixbuf);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
305
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
306 w = MIN(w, pixbuf_width - x);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
307 h = MIN(h, pixbuf_height - y);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
308
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
309 pix += x * ((cc->has_alpha) ? 4 : 3);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
310 for (i = 0; i < h; i++)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
311 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
312 guchar *pbuf;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
313
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
314 pbuf = pix + ((y + i) * rs);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 424
diff changeset
315
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
316 cmsDoTransform(cc->transform, pbuf, pbuf, w);
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 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
320
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
321 static gint color_man_idle_cb(gpointer data)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
322 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
323 ColorMan *cm = data;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
324 gint width, height;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
325 gint rh;
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 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
331 cm->idle_id = -1;
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
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
346 cm->idle_id = -1;
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,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
361 unsigned char *input_data, guint input_data_len,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
362 ColorManProfileType screen_type, const gchar *screen_file)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
363 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
364 ColorMan *cm;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
365 gint has_alpha;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
366
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
367 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
368
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
369 cm = g_new0(ColorMan, 1);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
370 cm->imd = imd;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
371 cm->pixbuf = pixbuf;
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
372 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
373
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
374 cm->incremental_sync = FALSE;
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
375 cm->row = 0;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
376 cm->idle_id = -1;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
377
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
378 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
379
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
380 cm->profile = color_man_cache_get(input_type, input_file, input_data, input_data_len,
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
381 screen_type, screen_file, has_alpha);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
382 if (!cm->profile)
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 color_man_free(cm);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
385 return NULL;
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
388 return cm;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
389 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
390
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
391 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
392 ColorManProfileType input_type, const gchar *input_file,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
393 ColorManProfileType screen_type, const gchar *screen_file)
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
394 {
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
395 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
396 input_type, input_file, NULL, 0,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
397 screen_type, screen_file);
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
398 }
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 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
401 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
402 cm->func_done = done_func;
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
403 cm->func_done_data = done_data;
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
404 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
405 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
406
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
407 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
408 unsigned char *input_data, guint input_data_len,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
409 ColorManProfileType screen_type, const gchar *screen_file)
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
410 {
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
411 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
412 COLOR_PROFILE_MEM, NULL, input_data, input_data_len,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
413 screen_type, screen_file);
114
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
414 }
50fc73e08550 Mon Nov 27 01:23:23 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
415
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
416 void color_man_free(ColorMan *cm)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
417 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
418 if (!cm) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
419
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
420 if (cm->idle_id != -1) 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
421 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
422
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
423 color_man_cache_unref(cm->profile);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
424
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
425 g_free(cm);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
426 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
427
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
428 void color_man_update(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
429 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
430 color_man_cache_reset();
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
431 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
432
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
433 #else
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
434 /*** color support not enabled ***/
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
435
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
436
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
437 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
438 ColorManProfileType input_type, const gchar *input_file,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
439 ColorManProfileType screen_type, const gchar *screen_file)
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
440 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
441 /* no op */
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
442 return NULL;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
443 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
444
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
445 ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
446 unsigned char *input_data, guint input_data_len,
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
447 ColorManProfileType screen_type, const gchar *screen_file)
115
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
448 {
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
449 /* no op */
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
450 return NULL;
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
451 }
53b2bfdcff69 Tue Nov 28 11:54:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 114
diff changeset
452
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
453 void color_man_free(ColorMan *cm)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
454 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
455 /* no op */
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
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
458 void color_man_update(void)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
459 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
460 /* no op */
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
398
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
463 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
464 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
465 /* no op */
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
466 }
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
467
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
468 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
469 {
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
470 /* no op */
c4080362d619 image post-processing (rotation and color management) moved to
nadvornik
parents: 281
diff changeset
471 }
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
472
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
473 #endif
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
474
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
475