diff options
Diffstat (limited to 'test/pixma_parse.h')
-rw-r--r-- | test/pixma_parse.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/test/pixma_parse.h b/test/pixma_parse.h index 3307204..0eda3c0 100644 --- a/test/pixma_parse.h +++ b/test/pixma_parse.h @@ -194,7 +194,7 @@ static inline void init_get_bits(GetBitContext *s, } -/* 10to8 decompression table */ +/* 10to8 decompression table for 2-bit inks with 3 levels: 3^5 = 243 combinations --- 5 pixels can be compressed into 1 byte */ static const unsigned short Table8[] = { 0x0,0x1,0x2,0x4,0x5,0x6,0x8,0x9,0xa,0x10,0x11,0x12,0x14,0x15,0x16, 0x18,0x19,0x1a,0x20,0x21,0x22,0x24,0x25,0x26,0x28,0x29,0x2a,0x40,0x41,0x42, @@ -215,6 +215,46 @@ static const unsigned short Table8[] = { 0x2a8,0x2a9,0x2aa,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 }; +/* 5-level decompression table for 4-bit inks with 5 levels: 5^3 = 125 combinations --- 3 pixels can be compressed into 1 byte */ +/* So then we can put 3 in the lower 8 */ +static const unsigned short Table5Level[] = { + 0x0,0x1,0x2,0x3,0x4,0x10,0x11,0x12,0x13,0x14,0x20,0x21,0x22,0x23,0x24,0x30, + 0x31,0x32,0x33,0x34,0x40,0x41,0x42,0x43,0x44,0x100,0x101,0x102,0x103,0x104,0x110,0x111, + 0x112,0x113,0x114,0x120,0x121,0x122,0x123,0x124,0x130,0x131,0x132,0x133,0x134,0x140,0x141,0x142, + 0x143,0x144,0x200,0x201,0x202,0x203,0x204,0x210,0x211,0x212,0x213,0x214,0x220,0x221,0x222,0x223, + 0x224,0x230,0x231,0x232,0x233,0x234,0x240,0x241,0x242,0x243,0x244,0x300,0x301,0x302,0x303,0x304, + 0x310,0x311,0x312,0x313,0x314,0x320,0x321,0x322,0x323,0x324,0x330,0x331,0x332,0x333,0x334,0x340, + 0x341,0x342,0x343,0x344,0x400,0x401,0x402,0x403,0x404,0x410,0x411,0x412,0x413,0x414,0x420,0x421, + 0x422,0x423,0x424,0x430,0x431,0x432,0x433,0x434,0x440,0x441,0x442,0x443,0x444,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; + +/* 6-level decompression table for 4-bit inks with 6 levels: 6^3 = 216 combinations --- 3 pixels can be compressed into 1 byte */ +static const unsigned short Table6Level[] = { + 0x0,0x1,0x2,0x3,0x4,0x5,0x10,0x11,0x12,0x13,0x14,0x15,0x20,0x21,0x22,0x23, + 0x24,0x25,0x30,0x31,0x32,0x33,0x34,0x35,0x40,0x41,0x42,0x43,0x44,0x45,0x50,0x51, + 0x52,0x53,0x54,0x55,0x100,0x101,0x102,0x103,0x104,0x105,0x110,0x111,0x112,0x113,0x114,0x115, + 0x120,0x121,0x122,0x123,0x124,0x125,0x130,0x131,0x132,0x133,0x134,0x135,0x140,0x141,0x142,0x143, + 0x144,0x145,0x150,0x151,0x152,0x153,0x154,0x155,0x200,0x201,0x202,0x203,0x204,0x205,0x210,0x211, + 0x212,0x213,0x214,0x215,0x220,0x221,0x222,0x223,0x224,0x225,0x230,0x231,0x232,0x233,0x234,0x235, + 0x240,0x241,0x242,0x243,0x244,0x245,0x250,0x251,0x252,0x253,0x254,0x255,0x300,0x301,0x302,0x303, + 0x304,0x305,0x310,0x311,0x312,0x313,0x314,0x315,0x320,0x321,0x322,0x323,0x324,0x325,0x330,0x331, + 0x332,0x333,0x334,0x335,0x340,0x341,0x342,0x343,0x344,0x345,0x350,0x351,0x352,0x353,0x354,0x355, + 0x400,0x401,0x402,0x403,0x404,0x405,0x410,0x411,0x412,0x413,0x414,0x415,0x420,0x421,0x422,0x423, + 0x424,0x425,0x430,0x431,0x432,0x433,0x434,0x435,0x440,0x441,0x442,0x443,0x444,0x445,0x450,0x451, + 0x452,0x453,0x454,0x455,0x500,0x501,0x502,0x503,0x504,0x505,0x510,0x511,0x512,0x513,0x514,0x515, + 0x520,0x521,0x522,0x523,0x524,0x525,0x530,0x531,0x532,0x533,0x534,0x535,0x540,0x541,0x542,0x543, + 0x544,0x545,0x550,0x551,0x552,0x553,0x554,0x555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 +}; typedef struct rasterline_s { unsigned char* buf; @@ -225,7 +265,7 @@ typedef struct rasterline_s { typedef struct color_s { - char name; /* name (one of CMYKcmykRGH) */ + char name; /* name (one of CMYKcmykH) */ int bpp; /* number of bits */ int level; /* number of levels */ int density; /* relative density to the other colors*/ @@ -258,8 +298,9 @@ typedef struct image_s { int lines_per_block; } image_t; -/*static const unsigned char valid_colors[] = {'C','M','Y','K','c','m','y','k',0xa3,0xad}; */ -static const unsigned char valid_colors[] = {'C','M','Y','K','c','m','y','k','R','G','H','A','B','D','E','F','I','J','L','M','N','O','P','Q','S','T','U','V','W','X','Z','a','b','d','e','f'}; +/* static const unsigned char valid_colors[] = {'C','M','Y','K','c','m','y','k'}; */ +/* static const unsigned char valid_colors[] = {'C','M','Y','K','c','m','y','k',0xa3,0xad}; */ +static const unsigned char valid_colors[] = {'C','M','Y','K','c','m','y','k','R','G','H','A','B','D','E','F','I','J','L','M','N','O','P','Q','S','T','U','V','W','X','Z','a','b','d','e','f'}; #endif |