28 #ifdef THUNDER_SUPPORT 45 #define THUNDER_DATA 0x3f 46 #define THUNDER_CODE 0xc0 48 #define THUNDER_RUN 0x00 49 #define THUNDER_2BITDELTAS 0x40 51 #define THUNDER_3BITDELTAS 0x80 53 #define THUNDER_RAW 0xc0 55 static const int twobitdeltas[4] = { 0, 1, 0, -1 };
56 static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 };
58 #define SETPIXEL(op, v) { \ 59 lastpixel = (v) & 0xf; \ 63 op[0] = (tidataval_t) (lastpixel << 4); \ 69 register unsigned char *bp;
71 unsigned int lastpixel;
78 while (cc > 0 && npixels < maxpixels) {
90 lastpixel = *op++; npixels++; n--;
92 lastpixel |= lastpixel << 4;
94 if (npixels < maxpixels) {
104 SETPIXEL(op, lastpixel + twobitdeltas[delta]);
106 SETPIXEL(op, lastpixel + twobitdeltas[delta]);
108 SETPIXEL(op, lastpixel + twobitdeltas[delta]);
112 SETPIXEL(op, lastpixel + threebitdeltas[delta]);
114 SETPIXEL(op, lastpixel + threebitdeltas[delta]);
123 if (npixels != maxpixels) {
125 "ThunderDecode: %s data at scanline %ld (%lu != %lu)",
126 npixels < maxpixels ?
"Not enough" :
"Too much",
127 (
long) tif->
tif_row, (
long) npixels, (
long) maxpixels);
139 while ((
long)occ > 0) {
TIFFCodeMethod tif_decoderow
int TIFFInitThunderScan(TIFF *tif, int scheme)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLenum GLvoid * row
TIFFCodeMethod tif_decodestrip
#define THUNDER_2BITDELTAS
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
#define THUNDER_3BITDELTAS
unsigned char tidataval_t