/src/gdal/frmts/gtiff/libtiff/tif_jpeg_12.c
Line | Count | Source (jump to first uncovered line) |
1 | | |
2 | | #include "tiffiop.h" |
3 | | |
4 | | #if defined(HAVE_JPEGTURBO_DUAL_MODE_8_12) |
5 | | #define JPEG_DUAL_MODE_8_12 |
6 | | #endif |
7 | | |
8 | | #if defined(JPEG_DUAL_MODE_8_12) |
9 | | |
10 | | #define FROM_TIF_JPEG_12 |
11 | | |
12 | | #ifdef TIFFInitJPEG |
13 | | #undef TIFFInitJPEG |
14 | | #endif |
15 | | #define TIFFInitJPEG TIFFInitJPEG_12 |
16 | | |
17 | | #ifdef TIFFJPEGIsFullStripRequired |
18 | | #undef TIFFJPEGIsFullStripRequired |
19 | | #endif |
20 | | #define TIFFJPEGIsFullStripRequired TIFFJPEGIsFullStripRequired_12 |
21 | | |
22 | | int TIFFInitJPEG_12(TIFF *tif, int scheme); |
23 | | |
24 | | #if !defined(HAVE_JPEGTURBO_DUAL_MODE_8_12) |
25 | | #include LIBJPEG_12_PATH |
26 | | #endif |
27 | | |
28 | | #include "tif_jpeg.c" |
29 | | |
30 | | int TIFFReInitJPEG_12(TIFF *tif, const JPEGOtherSettings *otherSettings, |
31 | | int scheme, int is_encode) |
32 | 0 | { |
33 | 0 | JPEGState *sp; |
34 | 0 | uint8_t *new_tif_data; |
35 | |
|
36 | 0 | (void)scheme; |
37 | 0 | assert(scheme == COMPRESSION_JPEG); |
38 | | |
39 | 0 | new_tif_data = |
40 | 0 | (uint8_t *)_TIFFreallocExt(tif, tif->tif_data, sizeof(JPEGState)); |
41 | |
|
42 | 0 | if (new_tif_data == NULL) |
43 | 0 | { |
44 | 0 | TIFFErrorExtR(tif, "TIFFReInitJPEG_12", |
45 | 0 | "No space for JPEG state block"); |
46 | 0 | return 0; |
47 | 0 | } |
48 | | |
49 | 0 | tif->tif_data = new_tif_data; |
50 | 0 | _TIFFmemset(tif->tif_data, 0, sizeof(JPEGState)); |
51 | |
|
52 | 0 | TIFFInitJPEGCommon(tif); |
53 | |
|
54 | 0 | sp = JState(tif); |
55 | 0 | sp->otherSettings = *otherSettings; |
56 | |
|
57 | 0 | if (is_encode) |
58 | 0 | return JPEGSetupEncode(tif); |
59 | 0 | else |
60 | 0 | return JPEGSetupDecode(tif); |
61 | 0 | } |
62 | | |
63 | | #endif /* defined(JPEG_DUAL_MODE_8_12) */ |