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