📄 stream-ccitt.h
字号:
//========================================================================//// Stream-CCITT.h//// Tables for CCITT Fax decoding.//// Copyright 1996-2003 Glyph & Cog, LLC////========================================================================struct CCITTCode { short bits; short n;};#define ccittEOL -2//------------------------------------------------------------------------// 2D codes//------------------------------------------------------------------------#define twoDimPass 0#define twoDimHoriz 1#define twoDimVert0 2#define twoDimVertR1 3#define twoDimVertL1 4#define twoDimVertR2 5#define twoDimVertL2 6#define twoDimVertR3 7#define twoDimVertL3 8// 1-7 bit codesstatic CCITTCode twoDimTab1[128] = { {-1, -1}, {-1, -1}, // 000000x {7, twoDimVertL3}, // 0000010 {7, twoDimVertR3}, // 0000011 {6, twoDimVertL2}, {6, twoDimVertL2}, // 000010x {6, twoDimVertR2}, {6, twoDimVertR2}, // 000011x {4, twoDimPass}, {4, twoDimPass}, // 0001xxx {4, twoDimPass}, {4, twoDimPass}, {4, twoDimPass}, {4, twoDimPass}, {4, twoDimPass}, {4, twoDimPass}, {3, twoDimHoriz}, {3, twoDimHoriz}, // 001xxxx {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimHoriz}, {3, twoDimVertL1}, {3, twoDimVertL1}, // 010xxxx {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertL1}, {3, twoDimVertR1}, {3, twoDimVertR1}, // 011xxxx {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {3, twoDimVertR1}, {1, twoDimVert0}, {1, twoDimVert0}, // 1xxxxxx {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}, {1, twoDimVert0}};//------------------------------------------------------------------------// white run lengths//------------------------------------------------------------------------// 11-12 bit codes (upper 7 bits are 0)static CCITTCode whiteTab1[32] = { {-1, -1}, // 00000 {12, ccittEOL}, // 00001 {-1, -1}, {-1, -1}, // 0001x {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 001xx {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 010xx {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 011xx {11, 1792}, {11, 1792}, // 1000x {12, 1984}, // 10010 {12, 2048}, // 10011 {12, 2112}, // 10100 {12, 2176}, // 10101 {12, 2240}, // 10110 {12, 2304}, // 10111 {11, 1856}, {11, 1856}, // 1100x {11, 1920}, {11, 1920}, // 1101x {12, 2368}, // 11100 {12, 2432}, // 11101 {12, 2496}, // 11110 {12, 2560} // 11111};// 1-9 bit codesstatic CCITTCode whiteTab2[512] = { {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, // 0000000xx {8, 29}, {8, 29}, // 00000010x {8, 30}, {8, 30}, // 00000011x {8, 45}, {8, 45}, // 00000100x {8, 46}, {8, 46}, // 00000101x {7, 22}, {7, 22}, {7, 22}, {7, 22}, // 0000011xx {7, 23}, {7, 23}, {7, 23}, {7, 23}, // 0000100xx {8, 47}, {8, 47}, // 00001010x {8, 48}, {8, 48}, // 00001011x {6, 13}, {6, 13}, {6, 13}, {6, 13}, // 000011xxx {6, 13}, {6, 13}, {6, 13}, {6, 13}, {7, 20}, {7, 20}, {7, 20}, {7, 20}, // 0001000xx {8, 33}, {8, 33}, // 00010010x {8, 34}, {8, 34}, // 00010011x {8, 35}, {8, 35}, // 00010100x {8, 36}, {8, 36}, // 00010101x {8, 37}, {8, 37}, // 00010110x {8, 38}, {8, 38}, // 00010111x {7, 19}, {7, 19}, {7, 19}, {7, 19}, // 0001100xx {8, 31}, {8, 31}, // 00011010x {8, 32}, {8, 32}, // 00011011x {6, 1}, {6, 1}, {6, 1}, {6, 1}, // 000111xxx {6, 1}, {6, 1}, {6, 1}, {6, 1}, {6, 12}, {6, 12}, {6, 12}, {6, 12}, // 001000xxx {6, 12}, {6, 12}, {6, 12}, {6, 12}, {8, 53}, {8, 53}, // 00100100x {8, 54}, {8, 54}, // 00100101x {7, 26}, {7, 26}, {7, 26}, {7, 26}, // 0010011xx {8, 39}, {8, 39}, // 00101000x {8, 40}, {8, 40}, // 00101001x {8, 41}, {8, 41}, // 00101010x {8, 42}, {8, 42}, // 00101011x {8, 43}, {8, 43}, // 00101100x {8, 44}, {8, 44}, // 00101101x {7, 21}, {7, 21}, {7, 21}, {7, 21}, // 0010111xx {7, 28}, {7, 28}, {7, 28}, {7, 28}, // 0011000xx {8, 61}, {8, 61}, // 00110010x {8, 62}, {8, 62}, // 00110011x {8, 63}, {8, 63}, // 00110100x {8, 0}, {8, 0}, // 00110101x {8, 320}, {8, 320}, // 00110110x {8, 384}, {8, 384}, // 00110111x {5, 10}, {5, 10}, {5, 10}, {5, 10}, // 00111xxxx {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 10}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, // 01000xxxx {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {5, 11}, {7, 27}, {7, 27}, {7, 27}, {7, 27}, // 0100100xx {8, 59}, {8, 59}, // 01001010x {8, 60}, {8, 60}, // 01001011x {9, 1472}, // 010011000 {9, 1536}, // 010011001 {9, 1600}, // 010011010 {9, 1728}, // 010011011 {7, 18}, {7, 18}, {7, 18}, {7, 18}, // 0100111xx {7, 24}, {7, 24}, {7, 24}, {7, 24}, // 0101000xx {8, 49}, {8, 49}, // 01010010x {8, 50}, {8, 50}, // 01010011x {8, 51}, {8, 51}, // 01010100x {8, 52}, {8, 52}, // 01010101x {7, 25}, {7, 25}, {7, 25}, {7, 25}, // 0101011xx {8, 55}, {8, 55}, // 01011000x {8, 56}, {8, 56}, // 01011001x {8, 57}, {8, 57}, // 01011010x {8, 58}, {8, 58}, // 01011011x {6, 192}, {6, 192}, {6, 192}, {6, 192}, // 010111xxx {6, 192}, {6, 192}, {6, 192}, {6, 192}, {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664}, // 011000xxx {6, 1664}, {6, 1664}, {6, 1664}, {6, 1664}, {8, 448}, {8, 448}, // 01100100x {8, 512}, {8, 512}, // 01100101x {9, 704}, // 011001100 {9, 768}, // 011001101 {8, 640}, {8, 640}, // 01100111x {8, 576}, {8, 576}, // 01101000x {9, 832}, // 011010010 {9, 896}, // 011010011 {9, 960}, // 011010100 {9, 1024}, // 011010101 {9, 1088}, // 011010110 {9, 1152}, // 011010111 {9, 1216}, // 011011000 {9, 1280}, // 011011001 {9, 1344}, // 011011010 {9, 1408}, // 011011011 {7, 256}, {7, 256}, {7, 256}, {7, 256}, // 0110111xx {4, 2}, {4, 2}, {4, 2}, {4, 2}, // 0111xxxxx {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 2}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, // 1000xxxxx {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -