Debian Codegraph @

tests/uncompressed_decode_rgb7.cc

raw
1 /*
2 libheif integration tests for uncompressed decoder
3
4 MIT License
5
6 Copyright (c) 2023 Brad Hards <[email protected]>
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25 */
26
27 #include "catch_amalgamated.hpp"
28 #include "libheif/heif.h"
29 #include "api_structs.h"
30 #include <cstdint>
31 #include <stdio.h>
32 #include "test_utils.h"
33 #include <string.h>
34
35 #include "uncompressed_decode.h"
36
37 void check_image_size_rgb7(struct heif_context *&context, int expect_alpha) {
38 heif_image_handle *handle = get_primary_image_handle(context);
39 heif_image *img = get_primary_image(handle);
40
41 REQUIRE(heif_image_has_channel(img, heif_channel_Y) == 0);
42 REQUIRE(heif_image_has_channel(img, heif_channel_Cb) == 0);
43 REQUIRE(heif_image_has_channel(img, heif_channel_Cr) == 0);
44 REQUIRE(heif_image_has_channel(img, heif_channel_R) == 1);
45 REQUIRE(heif_image_has_channel(img, heif_channel_G) == 1);
46 REQUIRE(heif_image_has_channel(img, heif_channel_B) == 1);
47 REQUIRE(heif_image_has_channel(img, heif_channel_Alpha) == expect_alpha);
48 REQUIRE(heif_image_has_channel(img, heif_channel_interleaved) == 0);
49 int width = heif_image_get_primary_width(img);
50 REQUIRE(width == 30);
51 int height = heif_image_get_primary_height(img);
52 REQUIRE(height == 20);
53 width = heif_image_get_width(img, heif_channel_R);
54 REQUIRE(width == 30);
55 height = heif_image_get_height(img, heif_channel_R);
56 REQUIRE(height == 20);
57 width = heif_image_get_width(img, heif_channel_G);
58 REQUIRE(width == 30);
59 height = heif_image_get_height(img, heif_channel_G);
60 REQUIRE(height == 20);
61 width = heif_image_get_width(img, heif_channel_B);
62 REQUIRE(width == 30);
63 height = heif_image_get_height(img, heif_channel_B);
64 REQUIRE(height == 20);
65 if (expect_alpha == 1) {
66 width = heif_image_get_width(img, heif_channel_Alpha);
67 REQUIRE(width == 30);
68 height = heif_image_get_height(img, heif_channel_Alpha);
69 REQUIRE(height == 20);
70 }
71
72 int pixel_depth = heif_image_get_bits_per_pixel(img, heif_channel_R);
73 REQUIRE(pixel_depth == 8);
74 pixel_depth = heif_image_get_bits_per_pixel(img, heif_channel_G);
75 REQUIRE(pixel_depth == 8);
76 pixel_depth = heif_image_get_bits_per_pixel(img, heif_channel_B);
77 REQUIRE(pixel_depth == 8);
78
79 int pixel_range = heif_image_get_bits_per_pixel_range(img, heif_channel_R);
80 REQUIRE(pixel_range == 7);
81 pixel_range = heif_image_get_bits_per_pixel_range(img, heif_channel_G);
82 REQUIRE(pixel_range == 7);
83 pixel_range = heif_image_get_bits_per_pixel_range(img, heif_channel_B);
84 REQUIRE(pixel_range == 7);
85
86 heif_image_release(img);
87 heif_image_handle_release(handle);
88 }
89
90 TEST_CASE("check image size 7 bit RGB") {
91 auto file = GENERATE(FILES_7BIT_RGB);
92 auto context = get_context_for_test_file(file);
93 INFO("file name: " << file);
94 int expect_alpha = (strchr(file, 'A') == NULL) ? 0 : 1;
95 check_image_size_rgb7(context, expect_alpha);
96 heif_context_free(context);
97 }
98
99 void check_image_content_rgb7(struct heif_context *&context) {
100 heif_image_handle *handle = get_primary_image_handle(context);
101 heif_image *img = get_primary_image(handle);
102
103 int stride;
104 const uint8_t *img_plane =
105 heif_image_get_plane_readonly(img, heif_channel_R, &stride);
106 REQUIRE(stride == 64);
107 for (int row = 0; row < 4; row++) {
108 INFO("row: " << row);
109 REQUIRE(((int)(img_plane[stride * row + 0])) == 127);
110 REQUIRE(((int)(img_plane[stride * row + 3])) == 127);
111 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
112 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
113 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
114 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
115 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
116 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
117 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
118 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
119 REQUIRE(((int)(img_plane[stride * row + 20])) == 127);
120 REQUIRE(((int)(img_plane[stride * row + 23])) == 127);
121 REQUIRE(((int)(img_plane[stride * row + 24])) == 0);
122 REQUIRE(((int)(img_plane[stride * row + 27])) == 0);
123 REQUIRE(((int)(img_plane[stride * row + 28])) == 63);
124 REQUIRE(((int)(img_plane[stride * row + 29])) == 63);
125 }
126 for (int row = 4; row < 8; row++) {
127 INFO("row: " << row);
128 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
129 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
130 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
131 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
132 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
133 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
134 REQUIRE(((int)(img_plane[stride * row + 12])) == 0);
135 REQUIRE(((int)(img_plane[stride * row + 15])) == 0);
136 REQUIRE(((int)(img_plane[stride * row + 16])) == 127);
137 REQUIRE(((int)(img_plane[stride * row + 19])) == 127);
138 REQUIRE(((int)(img_plane[stride * row + 20])) == 0);
139 REQUIRE(((int)(img_plane[stride * row + 23])) == 0);
140 REQUIRE(((int)(img_plane[stride * row + 24])) == 63);
141 REQUIRE(((int)(img_plane[stride * row + 27])) == 63);
142 REQUIRE(((int)(img_plane[stride * row + 28])) == 127);
143 REQUIRE(((int)(img_plane[stride * row + 29])) == 127);
144 }
145 for (int row = 8; row < 12; row++) {
146 INFO("row: " << row);
147 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
148 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
149 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
150 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
151 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
152 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
153 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
154 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
155 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
156 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
157 REQUIRE(((int)(img_plane[stride * row + 20])) == 63);
158 REQUIRE(((int)(img_plane[stride * row + 23])) == 63);
159 REQUIRE(((int)(img_plane[stride * row + 24])) == 127);
160 REQUIRE(((int)(img_plane[stride * row + 27])) == 127);
161 REQUIRE(((int)(img_plane[stride * row + 28])) == 118);
162 REQUIRE(((int)(img_plane[stride * row + 29])) == 118);
163 }
164 for (int row = 12; row < 16; row++) {
165 INFO("row: " << row);
166 REQUIRE(((int)(img_plane[stride * row + 0])) == 127);
167 REQUIRE(((int)(img_plane[stride * row + 3])) == 127);
168 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
169 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
170 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
171 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
172 REQUIRE(((int)(img_plane[stride * row + 12])) == 0);
173 REQUIRE(((int)(img_plane[stride * row + 15])) == 0);
174 REQUIRE(((int)(img_plane[stride * row + 16])) == 63);
175 REQUIRE(((int)(img_plane[stride * row + 19])) == 63);
176 REQUIRE(((int)(img_plane[stride * row + 20])) == 127);
177 REQUIRE(((int)(img_plane[stride * row + 23])) == 127);
178 REQUIRE(((int)(img_plane[stride * row + 24])) == 118);
179 REQUIRE(((int)(img_plane[stride * row + 27])) == 118);
180 REQUIRE(((int)(img_plane[stride * row + 28])) == 127);
181 REQUIRE(((int)(img_plane[stride * row + 29])) == 127);
182 }
183 for (int row = 16; row < 20; row++) {
184 INFO("row: " << row);
185 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
186 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
187 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
188 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
189 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
190 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
191 REQUIRE(((int)(img_plane[stride * row + 12])) == 63);
192 REQUIRE(((int)(img_plane[stride * row + 15])) == 63);
193 REQUIRE(((int)(img_plane[stride * row + 16])) == 127);
194 REQUIRE(((int)(img_plane[stride * row + 19])) == 127);
195 REQUIRE(((int)(img_plane[stride * row + 20])) == 118);
196 REQUIRE(((int)(img_plane[stride * row + 23])) == 118);
197 REQUIRE(((int)(img_plane[stride * row + 24])) == 127);
198 REQUIRE(((int)(img_plane[stride * row + 27])) == 127);
199 REQUIRE(((int)(img_plane[stride * row + 28])) == 0);
200 REQUIRE(((int)(img_plane[stride * row + 29])) == 0);
201 }
202 img_plane = heif_image_get_plane_readonly(img, heif_channel_G, &stride);
203 REQUIRE(stride == 64);
204 for (int row = 0; row < 4; row++) {
205 INFO("row: " << row);
206 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
207 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
208 REQUIRE(((int)(img_plane[stride * row + 4])) == 63);
209 REQUIRE(((int)(img_plane[stride * row + 7])) == 63);
210 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
211 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
212 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
213 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
214 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
215 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
216 REQUIRE(((int)(img_plane[stride * row + 20])) == 127);
217 REQUIRE(((int)(img_plane[stride * row + 23])) == 127);
218 REQUIRE(((int)(img_plane[stride * row + 24])) == 127);
219 REQUIRE(((int)(img_plane[stride * row + 27])) == 127);
220 REQUIRE(((int)(img_plane[stride * row + 28])) == 63);
221 REQUIRE(((int)(img_plane[stride * row + 29])) == 63);
222 }
223 for (int row = 4; row < 8; row++) {
224 INFO("row: " << row);
225 REQUIRE(((int)(img_plane[stride * row + 0])) == 63);
226 REQUIRE(((int)(img_plane[stride * row + 3])) == 63);
227 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
228 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
229 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
230 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
231 REQUIRE(((int)(img_plane[stride * row + 12])) == 0);
232 REQUIRE(((int)(img_plane[stride * row + 15])) == 0);
233 REQUIRE(((int)(img_plane[stride * row + 16])) == 127);
234 REQUIRE(((int)(img_plane[stride * row + 19])) == 127);
235 REQUIRE(((int)(img_plane[stride * row + 20])) == 127);
236 REQUIRE(((int)(img_plane[stride * row + 23])) == 127);
237 REQUIRE(((int)(img_plane[stride * row + 24])) == 63);
238 REQUIRE(((int)(img_plane[stride * row + 27])) == 63);
239 REQUIRE(((int)(img_plane[stride * row + 28])) == 82);
240 REQUIRE(((int)(img_plane[stride * row + 29])) == 82);
241 }
242 for (int row = 8; row < 12; row++) {
243 INFO("row: " << row);
244 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
245 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
246 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
247 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
248 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
249 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
250 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
251 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
252 REQUIRE(((int)(img_plane[stride * row + 16])) == 127);
253 REQUIRE(((int)(img_plane[stride * row + 19])) == 127);
254 REQUIRE(((int)(img_plane[stride * row + 20])) == 63);
255 REQUIRE(((int)(img_plane[stride * row + 23])) == 63);
256 REQUIRE(((int)(img_plane[stride * row + 24])) == 82);
257 REQUIRE(((int)(img_plane[stride * row + 27])) == 82);
258 REQUIRE(((int)(img_plane[stride * row + 28])) == 64);
259 REQUIRE(((int)(img_plane[stride * row + 29])) == 64);
260 }
261 for (int row = 12; row < 16; row++) {
262 INFO("row: " << row);
263 REQUIRE(((int)(img_plane[stride * row + 0])) == 127);
264 REQUIRE(((int)(img_plane[stride * row + 3])) == 127);
265 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
266 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
267 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
268 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
269 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
270 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
271 REQUIRE(((int)(img_plane[stride * row + 16])) == 63);
272 REQUIRE(((int)(img_plane[stride * row + 19])) == 63);
273 REQUIRE(((int)(img_plane[stride * row + 20])) == 82);
274 REQUIRE(((int)(img_plane[stride * row + 23])) == 82);
275 REQUIRE(((int)(img_plane[stride * row + 24])) == 64);
276 REQUIRE(((int)(img_plane[stride * row + 27])) == 64);
277 REQUIRE(((int)(img_plane[stride * row + 28])) == 0);
278 REQUIRE(((int)(img_plane[stride * row + 29])) == 0);
279 }
280 for (int row = 16; row < 20; row++) {
281 INFO("row: " << row);
282 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
283 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
284 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
285 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
286 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
287 REQUIRE(((int)(img_plane[stride * row + 9])) == 127);
288 REQUIRE(((int)(img_plane[stride * row + 12])) == 63);
289 REQUIRE(((int)(img_plane[stride * row + 15])) == 63);
290 REQUIRE(((int)(img_plane[stride * row + 16])) == 82);
291 REQUIRE(((int)(img_plane[stride * row + 19])) == 82);
292 REQUIRE(((int)(img_plane[stride * row + 20])) == 64);
293 REQUIRE(((int)(img_plane[stride * row + 23])) == 64);
294 REQUIRE(((int)(img_plane[stride * row + 24])) == 0);
295 REQUIRE(((int)(img_plane[stride * row + 27])) == 0);
296 REQUIRE(((int)(img_plane[stride * row + 28])) == 63);
297 REQUIRE(((int)(img_plane[stride * row + 29])) == 63);
298 }
299 img_plane = heif_image_get_plane_readonly(img, heif_channel_B, &stride);
300 REQUIRE(stride == 64);
301 for (int row = 0; row < 4; row++) {
302 INFO("row: " << row);
303 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
304 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
305 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
306 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
307 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
308 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
309 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
310 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
311 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
312 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
313 REQUIRE(((int)(img_plane[stride * row + 20])) == 0);
314 REQUIRE(((int)(img_plane[stride * row + 23])) == 0);
315 REQUIRE(((int)(img_plane[stride * row + 24])) == 127);
316 REQUIRE(((int)(img_plane[stride * row + 27])) == 127);
317 REQUIRE(((int)(img_plane[stride * row + 28])) == 63);
318 REQUIRE(((int)(img_plane[stride * row + 29])) == 63);
319 }
320 for (int row = 4; row < 8; row++) {
321 INFO("row: " << row);
322 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
323 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
324 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
325 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
326 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
327 REQUIRE(((int)(img_plane[stride * row + 11])) == 127);
328 REQUIRE(((int)(img_plane[stride * row + 12])) == 0);
329 REQUIRE(((int)(img_plane[stride * row + 15])) == 0);
330 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
331 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
332 REQUIRE(((int)(img_plane[stride * row + 20])) == 127);
333 REQUIRE(((int)(img_plane[stride * row + 23])) == 127);
334 REQUIRE(((int)(img_plane[stride * row + 24])) == 63);
335 REQUIRE(((int)(img_plane[stride * row + 27])) == 63);
336 REQUIRE(((int)(img_plane[stride * row + 28])) == 0);
337 REQUIRE(((int)(img_plane[stride * row + 29])) == 0);
338 }
339 for (int row = 8; row < 12; row++) {
340 INFO("row: " << row);
341 REQUIRE(((int)(img_plane[stride * row + 0])) == 127);
342 REQUIRE(((int)(img_plane[stride * row + 3])) == 127);
343 REQUIRE(((int)(img_plane[stride * row + 4])) == 127);
344 REQUIRE(((int)(img_plane[stride * row + 7])) == 127);
345 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
346 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
347 REQUIRE(((int)(img_plane[stride * row + 12])) == 0);
348 REQUIRE(((int)(img_plane[stride * row + 15])) == 0);
349 REQUIRE(((int)(img_plane[stride * row + 16])) == 127);
350 REQUIRE(((int)(img_plane[stride * row + 19])) == 127);
351 REQUIRE(((int)(img_plane[stride * row + 20])) == 63);
352 REQUIRE(((int)(img_plane[stride * row + 23])) == 63);
353 REQUIRE(((int)(img_plane[stride * row + 24])) == 0);
354 REQUIRE(((int)(img_plane[stride * row + 27])) == 0);
355 REQUIRE(((int)(img_plane[stride * row + 28])) == 118);
356 REQUIRE(((int)(img_plane[stride * row + 29])) == 118);
357 }
358 for (int row = 12; row < 16; row++) {
359 INFO("row: " << row);
360 REQUIRE(((int)(img_plane[stride * row + 0])) == 127);
361 REQUIRE(((int)(img_plane[stride * row + 3])) == 127);
362 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
363 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
364 REQUIRE(((int)(img_plane[stride * row + 8])) == 0);
365 REQUIRE(((int)(img_plane[stride * row + 11])) == 0);
366 REQUIRE(((int)(img_plane[stride * row + 12])) == 127);
367 REQUIRE(((int)(img_plane[stride * row + 15])) == 127);
368 REQUIRE(((int)(img_plane[stride * row + 16])) == 63);
369 REQUIRE(((int)(img_plane[stride * row + 19])) == 63);
370 REQUIRE(((int)(img_plane[stride * row + 20])) == 0);
371 REQUIRE(((int)(img_plane[stride * row + 23])) == 0);
372 REQUIRE(((int)(img_plane[stride * row + 24])) == 118);
373 REQUIRE(((int)(img_plane[stride * row + 27])) == 118);
374 REQUIRE(((int)(img_plane[stride * row + 28])) == 0);
375 REQUIRE(((int)(img_plane[stride * row + 29])) == 0);
376 }
377 for (int row = 16; row < 20; row++) {
378 INFO("row: " << row);
379 REQUIRE(((int)(img_plane[stride * row + 0])) == 0);
380 REQUIRE(((int)(img_plane[stride * row + 3])) == 0);
381 REQUIRE(((int)(img_plane[stride * row + 4])) == 0);
382 REQUIRE(((int)(img_plane[stride * row + 7])) == 0);
383 REQUIRE(((int)(img_plane[stride * row + 8])) == 127);
384 REQUIRE(((int)(img_plane[stride * row + 9])) == 127);
385 REQUIRE(((int)(img_plane[stride * row + 12])) == 63);
386 REQUIRE(((int)(img_plane[stride * row + 15])) == 63);
387 REQUIRE(((int)(img_plane[stride * row + 16])) == 0);
388 REQUIRE(((int)(img_plane[stride * row + 19])) == 0);
389 REQUIRE(((int)(img_plane[stride * row + 20])) == 118);
390 REQUIRE(((int)(img_plane[stride * row + 23])) == 118);
391 REQUIRE(((int)(img_plane[stride * row + 24])) == 0);
392 REQUIRE(((int)(img_plane[stride * row + 27])) == 0);
393 REQUIRE(((int)(img_plane[stride * row + 28])) == 0);
394 REQUIRE(((int)(img_plane[stride * row + 29])) == 0);
395 }
396
397 heif_image_release(img);
398 heif_image_handle_release(handle);
399 }
400
401 TEST_CASE("check image content 7 bit RGB") {
402 auto file = GENERATE(FILES_7BIT_RGB);
403 auto context = get_context_for_test_file(file);
404 INFO("file name: " << file);
405 check_image_content_rgb7(context);
406 heif_context_free(context);
407 }