diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-03 13:08:57 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-03 13:08:57 +0100 |
commit | 930713cf44bcae9a91f92a1582f329643d38abfd (patch) | |
tree | a02b43454a26174c905ef1e2035685eb7b6428e1 /readers.c | |
parent | 4ff884bd2510326dafb5adb97e69797d006b0e14 (diff) | |
download | fbida-930713cf44bcae9a91f92a1582f329643d38abfd.tar.gz |
add gfxfmt, fixes
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) |