diff options
Diffstat (limited to 'readers.c')
-rw-r--r-- | readers.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3,6 +3,7 @@ #include <stddef.h> #include <string.h> #include <assert.h> +#include <endian.h> #include "readers.h" @@ -130,8 +131,13 @@ int load_free_extras(struct ida_image_info *info) void ida_image_alloc(struct ida_image *img) { assert(img->p == NULL); - img->p = pixman_image_create_bits(/* PIXMAN_r8g8b8 */ PIXMAN_b8g8r8, - img->i.width, img->i.height, NULL, 0); + img->p = pixman_image_create_bits( +#if __BYTE_ORDER == __LITTLE_ENDIAN + PIXMAN_b8g8r8, +#else + PIXMAN_r8g8b8, +#endif + img->i.width, img->i.height, NULL, 0); } uint8_t *ida_image_scanline(struct ida_image *img, int y) |