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