tif_jpeg_12.c 1.6 KB

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