summaryrefslogtreecommitdiff
path: root/tiff/libtiff/tif_jpeg_12.c
blob: 87aaa19e0b1ddc8a180413f9eec4c2741cda5957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

#include "tiffiop.h"

#if defined(JPEG_DUAL_MODE_8_12)

#  define TIFFInitJPEG TIFFInitJPEG_12

#  include LIBJPEG_12_PATH

#  include "tif_jpeg.c"

int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode )

{
    JPEGState* sp;

    assert(scheme == COMPRESSION_JPEG);

    sp = JState(tif);
    sp->tif = tif;				/* back link */

    /*
     * Override parent get/set field methods.
     */
    tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */
    tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */
    tif->tif_tagmethods.printdir = JPEGPrintDir;   /* hook for codec tags */

    /*
     * Install codec methods.
     */
    tif->tif_fixuptags = JPEGFixupTags;
    tif->tif_setupdecode = JPEGSetupDecode;
    tif->tif_predecode = JPEGPreDecode;
    tif->tif_decoderow = JPEGDecode;
    tif->tif_decodestrip = JPEGDecode;
    tif->tif_decodetile = JPEGDecode;
    tif->tif_setupencode = JPEGSetupEncode;
    tif->tif_preencode = JPEGPreEncode;
    tif->tif_postencode = JPEGPostEncode;
    tif->tif_encoderow = JPEGEncode;
    tif->tif_encodestrip = JPEGEncode;
    tif->tif_encodetile = JPEGEncode;  
    tif->tif_cleanup = JPEGCleanup;
    tif->tif_defstripsize = JPEGDefaultStripSize;
    tif->tif_deftilesize = JPEGDefaultTileSize;
    tif->tif_flags |= TIFF_NOBITREV;	/* no bit reversal, please */

    sp->cinfo_initialized = FALSE;

    if( is_encode )
        return JPEGSetupEncode(tif);
    else
        return JPEGSetupDecode(tif);
}

#endif /* defined(JPEG_DUAL_MODE_8_12) */

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 8
 * fill-column: 78
 * End:
 */