Debian Codegraph @

testsuite/gdk/colorstate.c

raw symbols SCIP
1 #cxx . . $ `<file>/testsuite/gdk/colorstate.c`/include "config.h"cxx . . $ `<file>/build/config.h`/
2
3 #include <gdk/gdk.h>cxx . . $ `<file>/gdk/gdk.h`/
4 #include <math.h>
5
6 #include "udmabuf.h"cxx . . $ `<file>/testsuite/gdk/udmabuf.h`/
7
8 typedef enumcxx . . $ $anonymous_type_2a352f4352a3cde1_0# {
9 TEXTURE_METHOD_PLAINcxx . . $ TEXTURE_METHOD_PLAIN.,
10 TEXTURE_METHOD_DMABUFcxx . . $ TEXTURE_METHOD_DMABUF.
11 } TextureMethodcxx . . $ TextureMethod#;
12
13 static GdkColorStatecxx . . $ GdkColorState# *
14 get_color_statecxx . . $ get_color_state(15a22b45cf623619). (guintcxx . . $ guint# id,
15 const char **out_name)
16 {
17 const char *unused;
18
19 if (out_name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
20 out_name = &unused;
21
22 switch (id)
23 {
24 case 0:
25 *out_name = "srgb";
26 return gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (gdk_color_state_get_srgbcxx . . $ gdk_color_state_get_srgb(6b7eb4f7c55a0dc3). ());
27 case 1:
28 *out_name = "srgb-linear";
29 return gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (gdk_color_state_get_srgb_linearcxx . . $ gdk_color_state_get_srgb_linear(6b7eb4f7c55a0dc3). ());
30 case 2:
31 *out_name = "rec2100-pq";
32 return gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (gdk_color_state_get_rec2100_pqcxx . . $ gdk_color_state_get_rec2100_pq(6b7eb4f7c55a0dc3). ());
33 case 3:
34 *out_name = "rec2100-linear";
35 return gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (gdk_color_state_get_rec2100_linearcxx . . $ gdk_color_state_get_rec2100_linear(6b7eb4f7c55a0dc3). ());
36 default:
37 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
38 }
39 }
40
41 static void
42 test_equalcxx . . $ test_equal(49f6e7a06ebc5aa8). (void)
43 {
44 GdkColorStatecxx . . $ GdkColorState# *csi, *csj;
45 guintcxx . . $ guint# i, j;
46
47 for (i = 0; ; i++)
48 {
49 csi = get_color_statecxx . . $ get_color_state(15a22b45cf623619). (i, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
50 if (csi == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
51 break;
52
53 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_color_state_equal (csi, csi));
54
55 for (j = 0; ; j++)
56 {
57 csj = get_color_statecxx . . $ get_color_state(15a22b45cf623619). (j, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
58 if (csj == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
59 break;
60
61 if (i != j)
62 g_assert_falsecxx . . $ `<external>/15287032793271088244/gtestutils.h:232:9`! (gdk_color_state_equal (csi, csj));
63 else
64 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_color_state_equal (csi, csj)); /* might break for non-default? */
65 }
66 }
67 }
68
69 static float
70 image_distancecxx . . $ image_distance(88e2b0318e2c9bc4). (const gucharcxx . . $ guchar# *data,
71 gsizecxx . . $ gsize# stride,
72 const gucharcxx . . $ guchar# *data2,
73 gsizecxx . . $ gsize# stride2,
74 gsizecxx . . $ gsize# width,
75 gsizecxx . . $ gsize# height)
76 {
77 float dist = 0;
78 gsizecxx . . $ gsize# x, y, xmax = 0, ymax = 0;
79 float r1 = 0, g1 = 0, b1 = 0, a1 = 0;
80 float r2 = 0, g2 = 0, b2 = 0, a2 = 0;
81
82 for (y = 0; y < height; y++)
83 {
84 const float *p = (const float *) (data + y * stride);
85 const float *p2 = (const float *) (data2 + y * stride2);
86
87 for (x = 0; x < width; x++)
88 {
89 float dr, dg, db, da;
90
91 if (p[4 * x + 3] == 0 &&
92 p2[4 * x + 3] == 0)
93 continue;
94
95 dr = p[4 * x + 0] - p2[4 * x + 0];
96 dg = p[4 * x + 1] - p2[4 * x + 1];
97 db = p[4 * x + 2] - p2[4 * x + 2];
98 da = p[4 * x + 3] - p2[4 * x + 3];
99
100 float d = dr * dr + dg * dg + db * db + da * da;
101 if (d > dist)
102 {
103 dist = d;
104 xmax = x;
105 ymax = y;
106 r1 = p[4*x+0];
107 g1 = p[4*x+1];
108 b1 = p[4*x+2];
109 a1 = p[4*x+3];
110 r2 = p2[4*x+0];
111 g2 = p2[4*x+1];
112 b2 = p2[4*x+2];
113 a2 = p2[4*x+3];
114 }
115 }
116 }
117
118 if (g_test_verbosecxx . . $ `<external>/15287032793271088244/gtestutils.h:388:9`!() &&
119 dist > 0)
120 {
121 g_test_messagecxx . . $ g_test_message(326aeb464d16410c). ("worst pixel %" G_GSIZE_FORMATcxx . . $ `<external>/10505296616216143549/glibconfig.h:86:9`! " %" G_GSIZE_FORMATcxx . . $ `<external>/10505296616216143549/glibconfig.h:86:9`! ": %f %f %f %f vs %f %f %f %f\n",
122 xmax, ymax, r1, g1, b1, a1, r2, g2, b2, a2);
123 }
124
125 return sqrt (dist);
126 }
127
128 static void
129 test_convertcxx . . $ test_convert(fa86460dcd2db6da). (gconstpointercxx . . $ gconstpointer# testdata,
130 TextureMethodcxx . . $ TextureMethod# method,
131 float max_distance_premultiplied,
132 float max_distance_straight)
133 {
134 GdkColorStatecxx . . $ GdkColorState# *cs = (GdkColorStatecxx . . $ GdkColorState# *) testdata;
135 char *path;
136 GdkTexturecxx . . $ GdkTexture# *texture, *texture2;
137 GdkTextureDownloadercxx . . $ GdkTextureDownloader# *downloader;
138 GdkMemoryTextureBuildercxx . . $ GdkMemoryTextureBuilder# *membuild;
139 GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
140 GBytescxx . . $ GBytes# *bytes, *bytes2;
141 const gucharcxx . . $ guchar# *data, *data2;
142 gsizecxx . . $ gsize# stride, stride2;
143 gsizecxx . . $ gsize# width, height;
144 GdkMemoryFormatcxx . . $ GdkMemoryFormat# test_format;
145 float max_distance;
146
147 if (g_test_rand_bitcxx . . $ `<external>/15287032793271088244/gtestutils.h:571:10`! ())
148 {
149 max_distance = max_distance_premultiplied;
150 test_format = GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIEDcxx . . $ GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED.;
151 }
152 else
153 {
154 max_distance = max_distance_straight;
155 test_format = GDK_MEMORY_R32G32B32A32_FLOATcxx . . $ GDK_MEMORY_R32G32B32A32_FLOAT.;
156 }
157
158 path = g_test_build_filenamecxx . . $ g_test_build_filename(522294ea697604e8). (G_TEST_DISTcxx . . $ G_TEST_DIST., "image-data", "image.png", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
159
160 /* Create a texture */
161 texture = gdk_texture_new_from_filenamecxx . . $ gdk_texture_new_from_filename(15eb4ac4478b2622). (path, &error);
162 g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error);
163 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_color_state_equal (gdk_texture_get_color_state (texture),
164 gdk_color_state_get_srgb ()));
165 if (method == TEXTURE_METHOD_DMABUFcxx . . $ TEXTURE_METHOD_DMABUF.)
166 {
167 #ifdef HAVE_DRM_FOURCC_Hcxx . . $ `build/config.h:36:9`!
168 texture = udmabuf_texture_from_texturecxx . . $ udmabuf_texture_from_texture(443dec26b3d8ab02). (texture, &error);
169 #else
170 g_assert_not_reached ();
171 #endif
172 }
173 if (texture == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
174 {
175 g_test_skipcxx . . $ g_test_skip(85c52e162fed56f9). (error->messagecxx . . $ _GError#message.);
176 g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error);
177 return;
178 }
179
180 width = gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (texture);
181 height = gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (texture);
182
183 /* download the texture as float for later comparison */
184 downloader = gdk_texture_downloader_newcxx . . $ gdk_texture_downloader_new(b7a26057b8bfafc1). (texture);
185 gdk_texture_downloader_set_formatcxx . . $ gdk_texture_downloader_set_format(f9655a66992b052e). (downloader, test_format);
186 gdk_texture_downloader_set_color_statecxx . . $ gdk_texture_downloader_set_color_state(274415501bb7799d). (downloader, gdk_texture_get_color_statecxx . . $ gdk_texture_get_color_state(f424d3cc1ea19ea3). (texture));
187 bytes = gdk_texture_downloader_download_bytescxx . . $ gdk_texture_downloader_download_bytes(c7aa011941a936d4). (downloader, &stride);
188 data = g_bytes_get_datacxx . . $ g_bytes_get_data(e1c692f77020eb9f). (bytes, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
189
190 /* Download the texture into the test colorstate, this does a conversion */
191 gdk_texture_downloader_set_color_statecxx . . $ gdk_texture_downloader_set_color_state(274415501bb7799d). (downloader, cs);
192 bytes2 = gdk_texture_downloader_download_bytescxx . . $ gdk_texture_downloader_download_bytes(c7aa011941a936d4). (downloader, &stride2);
193
194 /* Create a new texture in the test colorstate with the just downloaded data */
195 membuild = gdk_memory_texture_builder_newcxx . . $ gdk_memory_texture_builder_new(be70910dc8432f2a). ();
196 gdk_memory_texture_builder_set_formatcxx . . $ gdk_memory_texture_builder_set_format(de595ae728e1869a). (membuild, test_format);
197 gdk_memory_texture_builder_set_color_statecxx . . $ gdk_memory_texture_builder_set_color_state(7be81aa75b9ab540). (membuild, cs);
198 gdk_memory_texture_builder_set_widthcxx . . $ gdk_memory_texture_builder_set_width(6483c3c2a49e939a). (membuild, width);
199 gdk_memory_texture_builder_set_heightcxx . . $ gdk_memory_texture_builder_set_height(6483c3c2a49e939a). (membuild, height);
200 gdk_memory_texture_builder_set_bytescxx . . $ gdk_memory_texture_builder_set_bytes(e77772228a910f37). (membuild, bytes2);
201 gdk_memory_texture_builder_set_stridecxx . . $ gdk_memory_texture_builder_set_stride(8b660659d5a7db8). (membuild, stride2);
202 texture2 = gdk_memory_texture_builder_buildcxx . . $ gdk_memory_texture_builder_build(56452dca8dd8909d). (membuild);
203 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (membuild);
204 g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes2);
205
206 /* Download the data of the new texture in the original texture's colorstate.
207 * This does the reverse conversion.
208 */
209 gdk_texture_downloader_set_texturecxx . . $ gdk_texture_downloader_set_texture(ed173dff2788080f). (downloader, texture2);
210 gdk_texture_downloader_set_color_statecxx . . $ gdk_texture_downloader_set_color_state(274415501bb7799d). (downloader, gdk_texture_get_color_statecxx . . $ gdk_texture_get_color_state(f424d3cc1ea19ea3). (texture));
211 bytes2 = gdk_texture_downloader_download_bytescxx . . $ gdk_texture_downloader_download_bytes(c7aa011941a936d4). (downloader, &stride2);
212 data2 = g_bytes_get_datacxx . . $ g_bytes_get_data(e1c692f77020eb9f). (bytes2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
213
214 /* Check that the conversions produce pixels that are close enough */
215 g_assert_cmpfloatcxx . . $ `<external>/15287032793271088244/gtestutils.h:91:9`! (image_distance (data, stride, data2, stride2, width, height), <, max_distance);
216
217 if (g_test_verbosecxx . . $ `<external>/15287032793271088244/gtestutils.h:388:9`! ())
218 g_test_messagecxx . . $ g_test_message(326aeb464d16410c). ("%g\n", image_distancecxx . . $ image_distance(88e2b0318e2c9bc4). (data, stride, data2, stride2, width, height));
219
220 g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes2);
221 g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes);
222 gdk_texture_downloader_freecxx . . $ gdk_texture_downloader_free(de357e450dee7ef3). (downloader);
223 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (texture2);
224 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (texture);
225 g_freecxx . . $ g_free(5d22bdacc48458e8). (path);
226 }
227
228 static void
229 test_convert_plaincxx . . $ test_convert_plain(e4289f82fef2c2f9). (gconstpointercxx . . $ gconstpointer# testdata)
230 {
231 test_convertcxx . . $ test_convert(fa86460dcd2db6da). (testdata, TEXTURE_METHOD_PLAINcxx . . $ TEXTURE_METHOD_PLAIN., 0.001, 0.001);
232 }
233
234 #ifdef HAVE_DRM_FOURCC_Hcxx . . $ `build/config.h:36:9`!
235 static void
236 test_convert_dmabufcxx . . $ test_convert_dmabuf(e4289f82fef2c2f9). (gconstpointercxx . . $ gconstpointer# testdata)
237 {
238 test_convertcxx . . $ test_convert(fa86460dcd2db6da). (testdata, TEXTURE_METHOD_DMABUFcxx . . $ TEXTURE_METHOD_DMABUF., 0.02, 0.005);
239 }
240 #endif
241
242 static void
243 test_pngcxx . . $ test_png(e4289f82fef2c2f9). (gconstpointercxx . . $ gconstpointer# testdata)
244 {
245 GdkColorStatecxx . . $ GdkColorState# *cs = (GdkColorStatecxx . . $ GdkColorState# *) testdata;
246 static const float texture_data[] = { 0,0,0,1, 0,0,1,1, 0,1,0,1, 0,1,1,1,
247 1,0,0,1, 1,0,1,1, 1,1,0,1, 1,1,1,1 };
248 static gsizecxx . . $ gsize# width = 4, height = 2, stride = 4 * 4 * sizeof (float);
249 GdkMemoryTextureBuildercxx . . $ GdkMemoryTextureBuilder# *membuild;
250 GdkTexturecxx . . $ GdkTexture# *saved, *loaded;
251 GBytescxx . . $ GBytes# *bytes;
252 GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
253
254 membuild = gdk_memory_texture_builder_newcxx . . $ gdk_memory_texture_builder_new(be70910dc8432f2a). ();
255 gdk_memory_texture_builder_set_formatcxx . . $ gdk_memory_texture_builder_set_format(de595ae728e1869a). (membuild, GDK_MEMORY_R32G32B32A32_FLOATcxx . . $ GDK_MEMORY_R32G32B32A32_FLOAT.);
256 gdk_memory_texture_builder_set_color_statecxx . . $ gdk_memory_texture_builder_set_color_state(7be81aa75b9ab540). (membuild, cs);
257 gdk_memory_texture_builder_set_widthcxx . . $ gdk_memory_texture_builder_set_width(6483c3c2a49e939a). (membuild, width);
258 gdk_memory_texture_builder_set_heightcxx . . $ gdk_memory_texture_builder_set_height(6483c3c2a49e939a). (membuild, height);
259 bytes = g_bytes_new_staticcxx . . $ g_bytes_new_static(d53317e535e97081). (texture_data, sizeof (texture_data));
260 gdk_memory_texture_builder_set_bytescxx . . $ gdk_memory_texture_builder_set_bytes(e77772228a910f37). (membuild, bytes);
261 g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes);
262 gdk_memory_texture_builder_set_stridecxx . . $ gdk_memory_texture_builder_set_stride(8b660659d5a7db8). (membuild, stride);
263 saved = gdk_memory_texture_builder_buildcxx . . $ gdk_memory_texture_builder_build(56452dca8dd8909d). (membuild);
264 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (membuild);
265
266 bytes = gdk_texture_save_to_png_bytescxx . . $ gdk_texture_save_to_png_bytes(a404c4dd36fb3b20). (saved);
267 loaded = gdk_texture_new_from_bytescxx . . $ gdk_texture_new_from_bytes(b2b37b4e3c8a1ebb). (bytes, &error);
268 g_assert_nonnullcxx . . $ `<external>/15287032793271088244/gtestutils.h:254:9`! (loaded);
269 g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error);
270 g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes);
271
272 g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:53:9`! (gdk_texture_get_width (saved), ==, gdk_texture_get_width (loaded));
273 g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:53:9`! (gdk_texture_get_height (saved), ==, gdk_texture_get_height (loaded));
274 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_color_state_equal (gdk_texture_get_color_state (saved), gdk_texture_get_color_state (loaded)));
275
276 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (saved);
277 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (loaded);
278 }
279
280 static void
281 test_cicpcxx . . $ test_cicp(49f6e7a06ebc5aa8). (void)
282 {
283 GdkCicpParamscxx . . $ GdkCicpParams# *params;
284 GdkColorStatecxx . . $ GdkColorState# *cs;
285 GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
286 GdkCicpParamscxx . . $ GdkCicpParams# *params2;
287
288 params = gdk_cicp_params_newcxx . . $ gdk_cicp_params_new(283c768a52b5efe). ();
289
290 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_cicp_params_get_color_primaries (params) == 2);
291 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_cicp_params_get_transfer_function (params) == 2);
292 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_cicp_params_get_matrix_coefficients (params) == 2);
293 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_cicp_params_get_range (params) == GDK_CICP_RANGE_NARROW);
294
295 cs = gdk_cicp_params_build_color_statecxx . . $ gdk_cicp_params_build_color_state(ce9d53891677d071). (params, &error);
296
297 g_assert_nullcxx . . $ `<external>/15287032793271088244/gtestutils.h:250:9`! (cs);
298 g_assert_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:222:9`! (error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILED);
299
300 g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error);
301
302 gdk_cicp_params_set_color_primariescxx . . $ gdk_cicp_params_set_color_primaries(b32e8aa544a2dda0). (params, 5);
303 gdk_cicp_params_set_transfer_functioncxx . . $ gdk_cicp_params_set_transfer_function(b32e8aa544a2dda0). (params, 1);
304 gdk_cicp_params_set_matrix_coefficientscxx . . $ gdk_cicp_params_set_matrix_coefficients(b32e8aa544a2dda0). (params, 0);
305 gdk_cicp_params_set_rangecxx . . $ gdk_cicp_params_set_range(b38579cf2fecac6d). (params, GDK_CICP_RANGE_FULLcxx . . $ GDK_CICP_RANGE_FULL.);
306
307 cs = gdk_cicp_params_build_color_statecxx . . $ gdk_cicp_params_build_color_state(ce9d53891677d071). (params, &error);
308
309 g_assert_nonnullcxx . . $ `<external>/15287032793271088244/gtestutils.h:254:9`! (cs);
310 g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error);
311
312 params2 = gdk_color_state_create_cicp_paramscxx . . $ gdk_color_state_create_cicp_params(d2481154bc049e2d). (cs);
313
314 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_cicp_params_get_color_primaries (params) == gdk_cicp_params_get_color_primaries (params2));
315 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (params2);
316
317 gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66). (cs);
318 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (params);
319 }
320
321 int
322 maincxx . . $ main(afcd3168fc1188a4). (int argc, char *argv[])
323 {
324 guintcxx . . $ guint# i;
325
326 (gtk_test_initcxx . . $ gtk_test_init(b91bcc5cc1349d78).) (&argc, &argv, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
327
328 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/colorstate/equal", test_equalcxx . . $ test_equal(49f6e7a06ebc5aa8).);
329 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/colorstate/cicp", test_cicpcxx . . $ test_cicp(49f6e7a06ebc5aa8).);
330
331 for (i = 0; ; i++)
332 {
333 GdkColorStatecxx . . $ GdkColorState# *csi;
334 const char *cs_name;
335 char *test_name;
336
337 csi = get_color_statecxx . . $ get_color_state(15a22b45cf623619). (i, &cs_name);
338 if (csi == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
339 break;
340
341 test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert-plain/srgb/%s", cs_name);
342 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (csi), test_convert_plaincxx . . $ test_convert_plain(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
343 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
344 #ifdef HAVE_DRM_FOURCC_Hcxx . . $ `build/config.h:36:9`!
345 test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert-dmabuf/srgb/%s", cs_name);
346 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (csi), test_convert_dmabufcxx . . $ test_convert_dmabuf(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
347 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
348 #endif
349 test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/png/%s", cs_name);
350 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (csi), test_pngcxx . . $ test_png(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
351 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
352
353 gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66). (csi);
354 }
355
356 GdkCicpParamscxx . . $ GdkCicpParams# *params = gdk_cicp_params_newcxx . . $ gdk_cicp_params_new(283c768a52b5efe). ();
357 for (guintcxx . . $ guint# primaries = 0; primaries < 32; primaries++)
358 {
359 gdk_cicp_params_set_color_primariescxx . . $ gdk_cicp_params_set_color_primaries(b32e8aa544a2dda0). (params, primaries);
360 for (guintcxx . . $ guint# tf = 0; tf < 32; tf++)
361 {
362 gdk_cicp_params_set_transfer_functioncxx . . $ gdk_cicp_params_set_transfer_function(b32e8aa544a2dda0). (params, tf);
363 for (guintcxx . . $ guint# matrix = 0; matrix < 32; matrix++)
364 {
365 GdkColorStatecxx . . $ GdkColorState# *color_state;
366
367 gdk_cicp_params_set_matrix_coefficientscxx . . $ gdk_cicp_params_set_matrix_coefficients(b32e8aa544a2dda0). (params, matrix);
368 gdk_cicp_params_set_rangecxx . . $ gdk_cicp_params_set_range(b38579cf2fecac6d). (params, GDK_CICP_RANGE_NARROWcxx . . $ GDK_CICP_RANGE_NARROW.);
369 color_state = gdk_cicp_params_build_color_statecxx . . $ gdk_cicp_params_build_color_state(ce9d53891677d071). (params, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
370
371 if (color_state)
372 {
373 char *test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert/plain/srgb/cicp/%u/%u/%u/0", primaries, tf, matrix);
374 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (color_state), test_convert_plaincxx . . $ test_convert_plain(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
375 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
376 #ifdef HAVE_DRM_FOURCC_Hcxx . . $ `build/config.h:36:9`!
377 test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert/dmabuf/srgb/cicp/%u/%u/%u/0", primaries, tf, matrix);
378 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (color_state), test_convert_dmabufcxx . . $ test_convert_dmabuf(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
379 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
380 #endif
381
382 gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66). (color_state);
383 }
384
385 gdk_cicp_params_set_rangecxx . . $ gdk_cicp_params_set_range(b38579cf2fecac6d). (params, GDK_CICP_RANGE_FULLcxx . . $ GDK_CICP_RANGE_FULL.);
386 color_state = gdk_cicp_params_build_color_statecxx . . $ gdk_cicp_params_build_color_state(ce9d53891677d071). (params, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
387 if (color_state)
388 {
389 char *test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert/plain/srgb/cicp/%u/%u/%u/1", primaries, tf, matrix);
390 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (color_state), test_convert_plaincxx . . $ test_convert_plain(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
391 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
392 #ifdef HAVE_DRM_FOURCC_Hcxx . . $ `build/config.h:36:9`!
393 test_name = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("/colorstate/convert/dmabuf/srgb/cicp/%u/%u/%u/1", primaries, tf, matrix);
394 g_test_add_data_func_fullcxx . . $ g_test_add_data_func_full(2b60da2de2229e7c). (test_name, gdk_color_state_refcxx . . $ gdk_color_state_ref(8feb2ce0a46ae897). (color_state), test_convert_dmabufcxx . . $ test_convert_dmabuf(e4289f82fef2c2f9)., (GDestroyNotifycxx . . $ GDestroyNotify#) gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66).);
395 g_freecxx . . $ g_free(5d22bdacc48458e8). (test_name);
396 #endif
397
398 gdk_color_state_unrefcxx . . $ gdk_color_state_unref(1604aa7719ab6e66). (color_state);
399 }
400 }
401 }
402 }
403
404 return g_test_runcxx . . $ g_test_run(b126dc7c1de90089). ();
405 }