aboutsummaryrefslogtreecommitdiffstats
path: root/readers.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:08:57 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:08:57 +0100
commit930713cf44bcae9a91f92a1582f329643d38abfd (patch)
treea02b43454a26174c905ef1e2035685eb7b6428e1 /readers.c
parent4ff884bd2510326dafb5adb97e69797d006b0e14 (diff)
downloadfbida-930713cf44bcae9a91f92a1582f329643d38abfd.tar.gz
add gfxfmt, fixes
Diffstat (limited to 'readers.c')
-rw-r--r--readers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/readers.c b/readers.c
index 24cb818..b7e8899 100644
--- a/readers.c
+++ b/readers.c
@@ -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)