tif_imageiter.h 2.1 KB

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