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 :
12 : int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode )
13 :
14 10 : {
15 : JPEGState* sp;
16 :
17 10 : assert(scheme == COMPRESSION_JPEG);
18 :
19 10 : sp = JState(tif);
20 10 : sp->tif = tif; /* back link */
21 :
22 : /*
23 : * Override parent get/set field methods.
24 : */
25 10 : tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */
26 10 : tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */
27 10 : tif->tif_tagmethods.printdir = JPEGPrintDir; /* hook for codec tags */
28 :
29 : /*
30 : * Install codec methods.
31 : */
32 10 : tif->tif_fixuptags = JPEGFixupTags;
33 10 : tif->tif_setupdecode = JPEGSetupDecode;
34 10 : tif->tif_predecode = JPEGPreDecode;
35 10 : tif->tif_decoderow = JPEGDecode;
36 10 : tif->tif_decodestrip = JPEGDecode;
37 10 : tif->tif_decodetile = JPEGDecode;
38 10 : tif->tif_setupencode = JPEGSetupEncode;
39 10 : tif->tif_preencode = JPEGPreEncode;
40 10 : tif->tif_postencode = JPEGPostEncode;
41 10 : tif->tif_encoderow = JPEGEncode;
42 10 : tif->tif_encodestrip = JPEGEncode;
43 10 : tif->tif_encodetile = JPEGEncode;
44 10 : tif->tif_cleanup = JPEGCleanup;
45 10 : tif->tif_defstripsize = JPEGDefaultStripSize;
46 10 : tif->tif_deftilesize = JPEGDefaultTileSize;
47 10 : tif->tif_flags |= TIFF_NOBITREV; /* no bit reversal, please */
48 :
49 10 : sp->cinfo_initialized = FALSE;
50 :
51 10 : if( is_encode )
52 3 : return JPEGSetupEncode(tif);
53 : else
54 7 : 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 : */
|