| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

tif_codec.c
Go to the documentation of this file.
1 /* $Header: /d1/sam/tiff/libtiff/RCS/tif_codec.c,v 1.12 1997/08/29 21:45:46 sam Exp $ */
2
3 /*
4 * Copyright (c) 1988-1997 Sam Leffler
5 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
6 *
7 * Permission to use, copy, modify, distribute, and sell this software and
8 * its documentation for any purpose is hereby granted without fee, provided
9 * that (i) the above copyright notices and this permission notice appear in
10 * all copies of the software and related documentation, and (ii) the names of
11 * Sam Leffler and Silicon Graphics may not be used in any advertising or
12 * publicity relating to the software without the specific, prior written
13 * permission of Sam Leffler and Silicon Graphics.
14 *
15 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 * OF THIS SOFTWARE.
25 */
26
27 /*
28 * TIFF Library
29 *
30 * Builtin Compression Scheme Configuration Support.
31 */
32 #include "tiffiop.h"
33
34 static int NotConfigured(TIFF*, int);
35
36 #ifndef LZW_SUPPORT
37 #define TIFFInitLZW NotConfigured
38 #endif
39 #ifndef PACKBITS_SUPPORT
40 #define TIFFInitPackbits NotConfigured
41 #endif
42 #ifndef THUNDER_SUPPORT
43 #define TIFFInitThunderScan NotConfigured
44 #endif
45 #ifndef NEXT_SUPPORT
46 #define TIFFInitNeXT NotConfigured
47 #endif
48 #ifndef JPEG_SUPPORT
49 #define TIFFInitJPEG NotConfigured
50 #endif
51 #ifndef OJPEG_SUPPORT
52 #define TIFFInitOJPEG NotConfigured
53 #endif
54 #ifndef CCITT_SUPPORT
55 #define TIFFInitCCITTRLE NotConfigured
56 #define TIFFInitCCITTRLEW NotConfigured
57 #define TIFFInitCCITTFax3 NotConfigured
58 #define TIFFInitCCITTFax4 NotConfigured
59 #endif
60 #ifndef JBIG_SUPPORT
61 #define TIFFInitJBIG NotConfigured
62 #endif
63 #ifndef ZIP_SUPPORT
64 #define TIFFInitZIP NotConfigured
65 #endif
66 #ifndef PIXARLOG_SUPPORT
67 #define TIFFInitPixarLog NotConfigured
68 #endif
69 #ifndef LOGLUV_SUPPORT
70 #define TIFFInitSGILog NotConfigured
71 #endif
72
73 /*
74 * Compression schemes statically built into the library.
75 */
76 #ifdef VMS
77 const TIFFCodec _TIFFBuiltinCODECS[] = {
78 #else
79 TIFFCodec _TIFFBuiltinCODECS[] = {
80 #endif
81 { "None", COMPRESSION_NONE, TIFFInitDumpMode },
82 { "LZW", COMPRESSION_LZW, TIFFInitLZW },
83 { "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits },
84 { "ThunderScan", COMPRESSION_THUNDERSCAN,TIFFInitThunderScan },
85 { "NeXT", COMPRESSION_NEXT, TIFFInitNeXT },
86 { "JPEG", COMPRESSION_JPEG, TIFFInitJPEG },
87 { "Old-style JPEG", COMPRESSION_OJPEG, TIFFInitOJPEG },
88 { "CCITT RLE", COMPRESSION_CCITTRLE, TIFFInitCCITTRLE },
89 { "CCITT RLE/W", COMPRESSION_CCITTRLEW, TIFFInitCCITTRLEW },
90 { "CCITT Group 3", COMPRESSION_CCITTFAX3, TIFFInitCCITTFax3 },
91 { "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 },
92 { "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG },
93 { "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP },
94 { "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog },
95 { "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog },
96 { "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog },
97 { NULL }
98 };
99
100 static int
101 _notConfigured(TIFF* tif)
102 {
103 const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
104
105 TIFFError(tif->tif_name,
106 "%s compression support is not configured", c->name);
107 return (0);
108 }
109
110 static int
111 NotConfigured(TIFF* tif, int scheme)
112 {
113 tif->tif_setupdecode = _notConfigured;
114 tif->tif_setupencode = _notConfigured;
115 return (1);
116 }
TIFFInitJPEG
#define TIFFInitJPEG
Definition: tif_codec.c:49
COMPRESSION_PACKBITS
#define COMPRESSION_PACKBITS
Definition: tiff.h:180
TIFFCodec
Definition: tiffio.h:240
_TIFFBuiltinCODECS
TIFFCodec _TIFFBuiltinCODECS[]
Definition: tif_codec.c:79
TIFFInitCCITTFax4
#define TIFFInitCCITTFax4
Definition: tif_codec.c:58
COMPRESSION_CCITTFAX3
#define COMPRESSION_CCITTFAX3
Definition: tiff.h:171
COMPRESSION_SGILOG24
#define COMPRESSION_SGILOG24
Definition: tiff.h:197
COMPRESSION_CCITTRLE
#define COMPRESSION_CCITTRLE
Definition: tiff.h:170
COMPRESSION_OJPEG
#define COMPRESSION_OJPEG
Definition: tiff.h:176
TIFFInitCCITTRLE
#define TIFFInitCCITTRLE
Definition: tif_codec.c:55
tiffiop.h
tiff::tif_name
char * tif_name
Definition: tiffiop.h:103
TIFFInitJBIG
#define TIFFInitJBIG
Definition: tif_codec.c:61
TIFFInitCCITTFax3
#define TIFFInitCCITTFax3
Definition: tif_codec.c:57
tiff
Definition: tiffiop.h:102
TIFFCodec::name
char * name
Definition: tiffio.h:241
COMPRESSION_DEFLATE
#define COMPRESSION_DEFLATE
Definition: tiff.h:190
COMPRESSION_CCITTFAX4
#define COMPRESSION_CCITTFAX4
Definition: tiff.h:173
TIFFInitZIP
#define TIFFInitZIP
Definition: tif_codec.c:64
TIFFInitCCITTRLEW
#define TIFFInitCCITTRLEW
Definition: tif_codec.c:56
TIFFInitSGILog
#define TIFFInitSGILog
Definition: tif_codec.c:70
COMPRESSION_CCITTRLEW
#define COMPRESSION_CCITTRLEW
Definition: tiff.h:179
COMPRESSION_PIXARLOG
#define COMPRESSION_PIXARLOG
Definition: tiff.h:189
TIFFInitThunderScan
#define TIFFInitThunderScan
Definition: tif_codec.c:43
COMPRESSION_JBIG
#define COMPRESSION_JBIG
Definition: tiff.h:195
TIFFInitLZW
#define TIFFInitLZW
Definition: tif_codec.c:37
TIFFInitOJPEG
#define TIFFInitOJPEG
Definition: tif_codec.c:52
TIFFFindCODEC
const TIFFCodec * TIFFFindCODEC(uint16 scheme)
Definition: tif_compress.c:179
COMPRESSION_NONE
#define COMPRESSION_NONE
Definition: tiff.h:169
COMPRESSION_SGILOG
#define COMPRESSION_SGILOG
Definition: tiff.h:196
COMPRESSION_JPEG
#define COMPRESSION_JPEG
Definition: tiff.h:177
TIFFError
void TIFFError(const char *module, const char *fmt,...)
Definition: tif_error.c:51
TIFFInitPackBits
int TIFFInitPackBits(TIFF *tif, int scheme)
Definition: tif_packbits.c:278
COMPRESSION_THUNDERSCAN
#define COMPRESSION_THUNDERSCAN
Definition: tiff.h:181
TIFFInitDumpMode
int TIFFInitDumpMode(TIFF *tif, int scheme)
Definition: tif_dumpmode.c:108
TIFFInitPixarLog
#define TIFFInitPixarLog
Definition: tif_codec.c:67
tiff::tif_dir
TIFFDirectory tif_dir
Definition: tiffiop.h:133
TIFFDirectory::td_compression
uint16 td_compression
Definition: tif_dir.h:46
TIFFInitNeXT
#define TIFFInitNeXT
Definition: tif_codec.c:46
COMPRESSION_LZW
#define COMPRESSION_LZW
Definition: tiff.h:175
tiff::tif_setupencode
TIFFBoolMethod tif_setupencode
Definition: tiffiop.h:155
COMPRESSION_NEXT
#define COMPRESSION_NEXT
Definition: tiff.h:178
tiff::tif_setupdecode
TIFFBoolMethod tif_setupdecode
Definition: tiffiop.h:153