| 1 |
typedef struct _TIFFImageIter TIFFImageIter; |
| 2 |
|
| 3 |
/* The callback function is called for each "block" of image pixel data after |
| 4 |
it has been read from the file and decoded. This image pixel data is in the |
| 5 |
buffer pp, and this data represents the image pixels from (x,y) to |
| 6 |
(x+w,y+h). It is stored in pixel format, so each pixel contains |
| 7 |
img->samplesperpixel consecutive samples each containing img->bitspersample |
| 8 |
bits of data. The array pp is ordered in h consecutive rows of w+fromskew |
| 9 |
pixels each. */ |
| 10 |
typedef void (*ImageIterTileContigRoutine)(TIFFImageIter *, void *, uint32_t, |
| 11 |
uint32_t, uint32_t, uint32_t, |
| 12 |
int32_t, unsigned char *); |
| 13 |
#define DECLAREContigCallbackFunc(name) \ |
| 14 |
static void name(TIFFImageIter *img, void *user_data, uint32_t x, \ |
| 15 |
uint32_t y, uint32_t w, uint32_t h, int32_t fromskew, \ |
| 16 |
u_char *pp) |
| 17 |
|
| 18 |
typedef void (*ImageIterTileSeparateRoutine)(TIFFImageIter *, void *, uint32_t, |
| 19 |
uint32_t, uint32_t, uint32_t, |
| 20 |
int32_t, unsigned char *, |
| 21 |
unsigned char *, unsigned char *, |
| 22 |
unsigned char *); |
| 23 |
#define DECLARESepCallbackFunc(name) \ |
| 24 |
static void name(TIFFImageIter *img, void *user_data, uint32_t x, \ |
| 25 |
uint32_t y, uint32_t w, uint32_t h, int32_t fromskew, \ |
| 26 |
u_char *r, u_char *g, u_char *b, u_char *a) |
| 27 |
|
| 28 |
struct _TIFFImageIter |
| 29 |
{ |
| 30 |
TIFF *tif; /* image handle */ |
| 31 |
int stoponerr; /* stop on read error */ |
| 32 |
int isContig; /* data is packed/separate */ |
| 33 |
int alpha; /* type of alpha data present */ |
| 34 |
uint32_t width; /* image width */ |
| 35 |
uint32_t height; /* image height */ |
| 36 |
uint16_t bitspersample; /* image bits/sample */ |
| 37 |
uint16_t samplesperpixel; /* image samples/pixel */ |
| 38 |
uint16_t orientation; /* image orientation */ |
| 39 |
uint16_t photometric; /* image photometric interp */ |
| 40 |
uint16_t *redcmap; /* colormap palette */ |
| 41 |
uint16_t *greencmap; |
| 42 |
uint16_t *bluecmap; |
| 43 |
/* get image data routine */ |
| 44 |
int (*get)(TIFFImageIter *, void *udata, uint32_t, uint32_t); |
| 45 |
union |
| 46 |
{ |
| 47 |
void (*any)(TIFFImageIter *); |
| 48 |
ImageIterTileContigRoutine contig; |
| 49 |
ImageIterTileSeparateRoutine separate; |
| 50 |
} callback; /* fn to exec for each block */ |
| 51 |
}; |