tif_jpeg_12.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include "tiffiop.h"
  2. #if defined(JPEG_DUAL_MODE_8_12)
  3. # define TIFFInitJPEG TIFFInitJPEG_12
  4. # define TIFFJPEGIsFullStripRequired TIFFJPEGIsFullStripRequired_12
  5. int
  6. TIFFInitJPEG_12(TIFF* tif, int scheme);
  7. # include LIBJPEG_12_PATH
  8. # include "tif_jpeg.c"
  9. int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode )
  10. {
  11. JPEGState* sp;
  12. assert(scheme == COMPRESSION_JPEG);
  13. sp = JState(tif);
  14. sp->tif = tif; /* back link */
  15. /*
  16. * Override parent get/set field methods.
  17. */
  18. tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */
  19. tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */
  20. tif->tif_tagmethods.printdir = JPEGPrintDir; /* hook for codec tags */
  21. /*
  22. * Install codec methods.
  23. */
  24. tif->tif_fixuptags = JPEGFixupTags;
  25. tif->tif_setupdecode = JPEGSetupDecode;
  26. tif->tif_predecode = JPEGPreDecode;
  27. tif->tif_decoderow = JPEGDecode;
  28. tif->tif_decodestrip = JPEGDecode;
  29. tif->tif_decodetile = JPEGDecode;
  30. tif->tif_setupencode = JPEGSetupEncode;
  31. tif->tif_preencode = JPEGPreEncode;
  32. tif->tif_postencode = JPEGPostEncode;
  33. tif->tif_encoderow = JPEGEncode;
  34. tif->tif_encodestrip = JPEGEncode;
  35. tif->tif_encodetile = JPEGEncode;
  36. tif->tif_cleanup = JPEGCleanup;
  37. tif->tif_defstripsize = JPEGDefaultStripSize;
  38. tif->tif_deftilesize = JPEGDefaultTileSize;
  39. tif->tif_flags |= TIFF_NOBITREV; /* no bit reversal, please */
  40. sp->cinfo_initialized = FALSE;
  41. if( is_encode )
  42. return JPEGSetupEncode(tif);
  43. else
  44. return JPEGSetupDecode(tif);
  45. }
  46. #endif /* defined(JPEG_DUAL_MODE_8_12) */
  47. /*
  48. * Local Variables:
  49. * mode: c
  50. * c-basic-offset: 8
  51. * fill-column: 78
  52. * End:
  53. */