4 #include "lib/mempool.h"
5 #include "images/images.h"
8 static uns want_image_iface;
11 test_image_iface(void)
14 struct image_thread it;
15 struct image *i1, *i2;
20 image_thread_init(&it);
22 i1 = image_new(&it, 731, 327, COLOR_SPACE_RGB, NULL);
24 ASSERT(i1->pixel_size == 3);
27 i1 = image_new(&it, 2214, 0, COLOR_SPACE_RGB, NULL);
30 i1 = image_new(&it, 0xffffff, 0xffffff, COLOR_SPACE_RGB, NULL);
33 i1 = image_new(&it, 370, 100, COLOR_SPACE_GRAYSCALE, pool);
35 ASSERT(i1->pixel_size == 1);
39 i1 = image_new(&it, 373, 101, COLOR_SPACE_RGB | IMAGE_ALIGNED, NULL);
41 ASSERT(i1->pixel_size == 4);
42 ASSERT(IMAGE_SSE_ALIGN_SIZE >= 16);
43 ASSERT(!(i1->row_size & (IMAGE_SSE_ALIGN_SIZE - 1)));
44 ASSERT(!((addr_int_t)i1->pixels & (IMAGE_SSE_ALIGN_SIZE - 1)));
47 i1 = image_new(&it, 283, 329, COLOR_SPACE_RGB, NULL);
49 ASSERT(i1->pixel_size == 3);
51 i2 = image_clone(&it, i1, COLOR_SPACE_RGB, NULL);
53 ASSERT(i2->pixel_size == 3);
56 i2 = image_clone(&it, i1, COLOR_SPACE_RGB | IMAGE_PIXELS_ALIGNED, NULL);
58 ASSERT(i2->pixel_size == 4);
61 i = image_init_subimage(&it, &s1, i1, 29, 39, 283 - 29, 100);
67 image_thread_cleanup(&it);
72 main(int argc, char **argv)
74 for (int i = 0; i < argc; i++)
75 if (!strcmp(argv[i], "image-iface"))