-static FASTCALL uint32_t
-fbFetchPixel_a8r8g8b8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- return READ(pict, (uint32_t *)bits + offset);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x8r8g8b8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- return READ(pict, (uint32_t *)bits + offset) | 0xff000000;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a8b8g8r8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint32_t *)bits + offset);
-
- return ((pixel & 0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x8b8g8r8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint32_t *)bits + offset);
-
- return ((0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_r8g8b8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint8_t *pixel = ((uint8_t *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (READ(pict, pixel + 0) << 16) |
- (READ(pict, pixel + 1) << 8) |
- (READ(pict, pixel + 2)));
-#else
- return (0xff000000 |
- (READ(pict, pixel + 2) << 16) |
- (READ(pict, pixel + 1) << 8) |
- (READ(pict, pixel + 0)));
-#endif
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_b8g8r8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint8_t *pixel = ((uint8_t *) bits) + (offset*3);
-#if IMAGE_BYTE_ORDER == MSBFirst
- return (0xff000000 |
- (READ(pict, pixel + 2) << 16) |
- (READ(pict, pixel + 1) << 8) |
- (READ(pict, pixel + 0)));
-#else
- return (0xff000000 |
- (READ(pict, pixel + 0) << 16) |
- (READ(pict, pixel + 1) << 8) |
- (READ(pict, pixel + 2)));
-#endif
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_r5g6b5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_b5g6r5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a1r5g5b5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (a | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x1r5g5b5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a1b5g5r5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (a | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x1b5g5r5 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a4r4g4b4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (a | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x4r4g4b4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a4b4g4r4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
- return (a | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x4b4g4r4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint16_t *) bits + offset);
-
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- return pixel << 24;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_r3g3b2 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- r = ((pixel & 0xe0) | ((pixel & 0xe0) >> 3) | ((pixel & 0xc0) >> 6)) << 16;
- g = ((pixel & 0x1c) | ((pixel & 0x18) >> 3) | ((pixel & 0x1c) << 3)) << 8;
- b = (((pixel & 0x03) ) |
- ((pixel & 0x03) << 2) |
- ((pixel & 0x03) << 4) |
- ((pixel & 0x03) << 6));
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_b2g3r3 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- b = (((pixel & 0xc0) ) |
- ((pixel & 0xc0) >> 2) |
- ((pixel & 0xc0) >> 4) |
- ((pixel & 0xc0) >> 6));
- g = ((pixel & 0x38) | ((pixel & 0x38) >> 3) | ((pixel & 0x30) << 2)) << 8;
- r = (((pixel & 0x07) ) |
- ((pixel & 0x07) << 3) |
- ((pixel & 0x06) << 6)) << 16;
- return (0xff000000 | r | g | b);
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a2r2g2b2 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- r = ((pixel & 0x30) * 0x55) << 12;
- g = ((pixel & 0x0c) * 0x55) << 6;
- b = ((pixel & 0x03) * 0x55);
- return a|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a2b2g2r2 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- b = ((pixel & 0x30) * 0x55) >> 6;
- g = ((pixel & 0x0c) * 0x55) << 6;
- r = ((pixel & 0x03) * 0x55) << 16;
- return a|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_c8 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
- const pixman_indexed_t * indexed = pict->indexed;
- return indexed->rgba[pixel];
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_x4a4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, (uint8_t *) bits + offset);
-
- return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
-
- pixel |= pixel << 4;
- return pixel << 24;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_r1g2b1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
-
- r = ((pixel & 0x8) * 0xff) << 13;
- g = ((pixel & 0x6) * 0x55) << 7;
- b = ((pixel & 0x1) * 0xff);
- return 0xff000000|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_b1g2r1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
-
- b = ((pixel & 0x8) * 0xff) >> 3;
- g = ((pixel & 0x6) * 0x55) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
- return 0xff000000|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a1r1g1b1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) << 14;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff);
- return a|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_a1b1g1r1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t a,r,g,b;
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) >> 3;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff) << 16;
- return a|r|g|b;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_c4 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = Fetch4(pict, bits, offset);
- const pixman_indexed_t * indexed = pict->indexed;
-
- return indexed->rgba[pixel];
-}
-
-
-static FASTCALL uint32_t
-fbFetchPixel_a1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, bits + (offset >> 5));
- uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
- return a << 24;
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_g1 (bits_image_t *pict, int offset, int line)
-{
- uint32_t *bits = pict->bits + line*pict->rowstride;
- uint32_t pixel = READ(pict, bits + (offset >> 5));
- const pixman_indexed_t * indexed = pict->indexed;
- uint32_t a;
-#if BITMAP_BIT_ORDER == MSBFirst
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- return indexed->rgba[a];
-}
-
-static FASTCALL uint32_t
-fbFetchPixel_yuy2 (bits_image_t *pict, int offset, int line)
-{