29#define CVAL(p) (*(p++))
32#define CVAL2(p, v) { v = (*(p++)); v |= (*(p++)) << 8; }
34#define CVAL2(p, v) { v = (*(p++)) << 8; v |= (*(p++)); }
37#define CVAL2(p, v) { v = (*((uint16*)p)); p += 2; }
40#define UNROLL8(exp) { exp exp exp exp exp exp exp exp }
42#define REPEAT(statement) \
44 while((count & ~0x7) && ((x+8) < width)) \
45 UNROLL8( statement; count--; x++; ); \
47 while((count > 0) && (x < width)) \
55#define MASK_UPDATE() \
60 mask = fom_mask ? fom_mask : CVAL(input); \
72 int lastopcode = -1, insertmix =
False, bicolour =
False;
74 uint8 colour1 = 0, colour2 = 0;
103 count = (opcode < 0xb) ? 8 : 1;
116 isfillormix = ((opcode == 2) || (opcode == 7));
124 else if (isfillormix)
133 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
176 if (prevline ==
NULL)
184 if (prevline ==
NULL)
194 if (prevline ==
NULL)
204 if (prevline ==
NULL)
255 unimpl(
"bitmap opcode 0x%x\n", opcode);
270 int lastopcode = -1, insertmix =
False, bicolour =
False;
272 uint16 colour1 = 0, colour2 = 0;
301 count = (opcode < 0xb) ? 8 : 1;
314 isfillormix = ((opcode == 2) || (opcode == 7));
322 else if (isfillormix)
331 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
374 if (prevline ==
NULL)
382 if (prevline ==
NULL)
392 if (prevline ==
NULL)
402 if (prevline ==
NULL)
454 unimpl(
"bitmap opcode 0x%x\n", opcode);
469 int lastopcode = -1, insertmix =
False, bicolour =
False;
471 uint8 colour1[3] = {0, 0, 0}, colour2[3] = {0, 0, 0};
514 isfillormix = ((opcode == 2) || (opcode == 7));
522 else if (isfillormix)
531 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
580 if (prevline ==
NULL)
589 prevline[
x * 3] ^
mix[0];
591 prevline[
x * 3 + 1] ^
mix[1];
593 prevline[
x * 3 + 2] ^
mix[2];
599 if (prevline ==
NULL)
612 line[
x * 3] = prevline[
x * 3];
613 line[
x * 3 + 1] = prevline[
x * 3 + 1];
614 line[
x * 3 + 2] = prevline[
x * 3 + 2];
619 if (prevline ==
NULL)
633 prevline[
x * 3] ^
mix[0];
635 prevline[
x * 3 + 1] ^
mix[1];
637 prevline[
x * 3 + 2] ^
mix[2];
642 if (prevline ==
NULL)
669 prevline[
x * 3] ^
mix [0];
671 prevline[
x * 3 + 1] ^
mix [1];
673 prevline[
x * 3 + 2] ^
mix [2];
690 line[
x * 3] = colour2 [0];
691 line[
x * 3 + 1] = colour2 [1];
692 line[
x * 3 + 2] = colour2 [2];
708 line[
x * 3] = colour2[0];
709 line[
x * 3 + 1] = colour2[1];
710 line[
x * 3 + 2] = colour2[2];
715 line[
x * 3] = colour1[0];
716 line[
x * 3 + 1] = colour1[1];
717 line[
x * 3 + 2] = colour1[2];
727 line[
x * 3 + 1] = 0xff;
728 line[
x * 3 + 2] = 0xff;
740 unimpl(
"bitmap opcode 0x%x\n", opcode);
777 while (indexw <
width)
781 collen = (
code >> 4) & 0xf;
782 revcode = (replen << 4) | collen;
783 if ((revcode <= 47) && (revcode >= 16))
807 while (indexw <
width)
811 collen = (
code >> 4) & 0xf;
812 revcode = (replen << 4) | collen;
813 if ((revcode <= 47) && (revcode >= 16))
832 x = last_line[indexw * 4] +
color;
840 x = last_line[indexw * 4] +
color;
849 last_line = this_line;
851 return (
int) (
in - org_in);
869 total_pro += bytes_pro;
872 total_pro += bytes_pro;
875 total_pro += bytes_pro;
878 total_pro += bytes_pro;
879 return size == total_pro;
static int process_plane(uint8 *in, int width, int height, uint8 *out, int size)
static RD_BOOL bitmap_decompress1(uint8 *output, int width, int height, uint8 *input, int size)
static RD_BOOL bitmap_decompress3(uint8 *output, int width, int height, uint8 *input, int size)
static RD_BOOL bitmap_decompress4(uint8 *output, int width, int height, uint8 *input, int size)
RD_BOOL bitmap_decompress(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
static RD_BOOL bitmap_decompress2(uint8 *output, int width, int height, uint8 *input, int size)
#define REPEAT(statement)
void unimpl(char *format,...)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLenum GLenum input
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix