const uint8_t *end = pixel + 3*width;
while (pixel < end) {
uint32_t b = 0xff000000;
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
b |= (READ(pict, pixel++));
b |= (READ(pict, pixel++) << 8);
b |= (READ(pict, pixel++) << 16);
}
#define Fetch8(img,l,o) (READ(img, (uint8_t *)(l) + ((o) >> 2)))
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) & 0xf : Fetch8(img,l,o) >> 4)
#else
#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) >> 4 : Fetch8(img,l,o) & 0xf)
for (i = 0; i < width; ++i) {
uint32_t p = READ(pict, bits + ((i + x) >> 5));
uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
a = p >> (0x1f - ((i+x) & 0x1f));
#else
a = p >> ((i+x) & 0x1f);
for (i = 0; i < width; ++i) {
uint32_t p = READ(pict, bits + ((i+x) >> 5));
uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
a = p >> (0x1f - ((i+x) & 0x1f));
#else
a = p >> ((i+x) & 0x1f);
{
uint32_t *bits = pict->bits + line*pict->rowstride;
uint8_t *pixel = ((uint8_t *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
buffer[i] = (0xff000000 |
(READ(pict, pixel + 0) << 16) |
(READ(pict, pixel + 1) << 8) |
{
uint32_t *bits = pict->bits + line*pict->rowstride;
uint8_t *pixel = ((uint8_t *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
buffer[i] = (0xff000000 |
(READ(pict, pixel + 2) << 16) |
(READ(pict, pixel + 1) << 8) |
uint32_t *bits = pict->bits + line*pict->rowstride;
uint32_t pixel = READ(pict, bits + (offset >> 5));
uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
a = pixel >> (0x1f - (offset & 0x1f));
#else
a = pixel >> (offset & 0x1f);
uint32_t pixel = READ(pict, bits + (offset >> 5));
const pixman_indexed_t * indexed = pict->indexed;
uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
a = pixel >> (0x1f - (offset & 0x1f));
#else
a = pixel >> (offset & 0x1f);
uint8_t *pixel = ((uint8_t *) bits) + 3*x;
for (i = 0; i < width; ++i) {
uint32_t val = values[i];
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
WRITE(image, pixel++, Blue(val));
WRITE(image, pixel++, Green(val));
WRITE(image, pixel++, Red(val));
}
#define Store8(img,l,o,v) (WRITE(img, (uint8_t *)(l) + ((o) >> 3), (v)))
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
#define Store4(img,l,o,v) Store8(img,l,o,((o) & 4 ? \
(Fetch8(img,l,o) & 0xf0) | (v) : \
(Fetch8(img,l,o) & 0x0f) | ((v) << 4)))
#define TRUE 1
#endif
-#define MSBFirst 0
-#define LSBFirst 1
-
-#ifdef WORDS_BIGENDIAN
-# define IMAGE_BYTE_ORDER MSBFirst
-# define BITMAP_BIT_ORDER MSBFirst
-#else
-# define IMAGE_BYTE_ORDER LSBFirst
-# define BITMAP_BIT_ORDER LSBFirst
-#endif
-
#undef DEBUG
#define DEBUG 0
#define FB_STIP_MASK (FB_STIP_UNIT - 1)
#define FB_STIP_ALLONES ((uint32_t) -1)
-#if BITMAP_BIT_ORDER == LSBFirst
-#define FbScrLeft(x,n) ((x) >> (n))
-#define FbScrRight(x,n) ((x) << (n))
-#define FbLeftStipBits(x,n) ((x) & ((((uint32_t) 1) << (n)) - 1))
-#else
+#ifdef WORDS_BIGENDIAN
#define FbScrLeft(x,n) ((x) << (n))
#define FbScrRight(x,n) ((x) >> (n))
#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
+#else
+#define FbScrLeft(x,n) ((x) >> (n))
+#define FbScrRight(x,n) ((x) << (n))
+#define FbLeftStipBits(x,n) ((x) & ((((uint32_t) 1) << (n)) - 1))
#endif
#define FbStipLeft(x,n) FbScrLeft(x,n)
n >>= FB_SHIFT; \
}
-#if IMAGE_BYTE_ORDER == MSBFirst
+#ifdef WORDS_BIGENDIAN
#define Fetch24(img, a) ((unsigned long) (a) & 1 ? \
((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \
((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2)))