ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

tif_codec.c
Go to the documentation of this file.
00001 /* $Id: tif_codec.c,v 1.10.2.2 2010-06-08 18:50:41 bfriesen Exp $ */
00002 
00003 /*
00004  * Copyright (c) 1988-1997 Sam Leffler
00005  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
00006  *
00007  * Permission to use, copy, modify, distribute, and sell this software and 
00008  * its documentation for any purpose is hereby granted without fee, provided
00009  * that (i) the above copyright notices and this permission notice appear in
00010  * all copies of the software and related documentation, and (ii) the names of
00011  * Sam Leffler and Silicon Graphics may not be used in any advertising or
00012  * publicity relating to the software without the specific, prior written
00013  * permission of Sam Leffler and Silicon Graphics.
00014  * 
00015  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
00016  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
00017  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
00018  * 
00019  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
00020  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
00021  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00022  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
00023  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
00024  * OF THIS SOFTWARE.
00025  */
00026 
00027 /*
00028  * TIFF Library
00029  *
00030  * Builtin Compression Scheme Configuration Support.
00031  */
00032 #include "tiffiop.h"
00033 
00034 static  int NotConfigured(TIFF*, int);
00035 
00036 #ifndef LZW_SUPPORT
00037 #define TIFFInitLZW     NotConfigured
00038 #endif
00039 #ifndef PACKBITS_SUPPORT
00040 #define TIFFInitPackBits    NotConfigured
00041 #endif
00042 #ifndef THUNDER_SUPPORT
00043 #define TIFFInitThunderScan NotConfigured
00044 #endif
00045 #ifndef NEXT_SUPPORT
00046 #define TIFFInitNeXT        NotConfigured
00047 #endif
00048 #ifndef JPEG_SUPPORT
00049 #define TIFFInitJPEG        NotConfigured
00050 #endif
00051 #ifndef OJPEG_SUPPORT
00052 #define TIFFInitOJPEG       NotConfigured
00053 #endif
00054 #ifndef CCITT_SUPPORT
00055 #define TIFFInitCCITTRLE    NotConfigured
00056 #define TIFFInitCCITTRLEW   NotConfigured
00057 #define TIFFInitCCITTFax3   NotConfigured
00058 #define TIFFInitCCITTFax4   NotConfigured
00059 #endif
00060 #ifndef JBIG_SUPPORT
00061 #define TIFFInitJBIG        NotConfigured
00062 #endif
00063 #ifndef ZIP_SUPPORT
00064 #define TIFFInitZIP     NotConfigured
00065 #endif
00066 #ifndef PIXARLOG_SUPPORT
00067 #define TIFFInitPixarLog    NotConfigured
00068 #endif
00069 #ifndef LOGLUV_SUPPORT
00070 #define TIFFInitSGILog      NotConfigured
00071 #endif
00072 
00073 /*
00074  * Compression schemes statically built into the library.
00075  */
00076 #ifdef VMS
00077 const TIFFCodec _TIFFBuiltinCODECS[] = {
00078 #else
00079 TIFFCodec _TIFFBuiltinCODECS[] = {
00080 #endif
00081     { "None",       COMPRESSION_NONE,   TIFFInitDumpMode },
00082     { "LZW",        COMPRESSION_LZW,    TIFFInitLZW },
00083     { "PackBits",   COMPRESSION_PACKBITS,   TIFFInitPackBits },
00084     { "ThunderScan",    COMPRESSION_THUNDERSCAN,TIFFInitThunderScan },
00085     { "NeXT",       COMPRESSION_NEXT,   TIFFInitNeXT },
00086     { "JPEG",       COMPRESSION_JPEG,   TIFFInitJPEG },
00087     { "Old-style JPEG", COMPRESSION_OJPEG,  TIFFInitOJPEG },
00088     { "CCITT RLE",  COMPRESSION_CCITTRLE,   TIFFInitCCITTRLE },
00089     { "CCITT RLE/W",    COMPRESSION_CCITTRLEW,  TIFFInitCCITTRLEW },
00090     { "CCITT Group 3",  COMPRESSION_CCITTFAX3,  TIFFInitCCITTFax3 },
00091     { "CCITT Group 4",  COMPRESSION_CCITTFAX4,  TIFFInitCCITTFax4 },
00092     { "ISO JBIG",   COMPRESSION_JBIG,   TIFFInitJBIG },
00093     { "Deflate",    COMPRESSION_DEFLATE,    TIFFInitZIP },
00094     { "AdobeDeflate",   COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, 
00095     { "PixarLog",   COMPRESSION_PIXARLOG,   TIFFInitPixarLog },
00096     { "SGILog",     COMPRESSION_SGILOG, TIFFInitSGILog },
00097     { "SGILog24",   COMPRESSION_SGILOG24,   TIFFInitSGILog },
00098     { NULL,             0,                      NULL }
00099 };
00100 
00101 static int
00102 _notConfigured(TIFF* tif)
00103 {
00104     const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
00105         char compression_code[20];
00106         
00107         sprintf( compression_code, "%d", tif->tif_dir.td_compression );
00108     TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
00109                      "%s compression support is not configured", 
00110                      c ? c->name : compression_code );
00111     return (0);
00112 }
00113 
00114 static int
00115 NotConfigured(TIFF* tif, int scheme)
00116 {
00117     (void) scheme;
00118     
00119     tif->tif_decodestatus = FALSE;
00120     tif->tif_setupdecode = _notConfigured;
00121     tif->tif_encodestatus = FALSE;
00122     tif->tif_setupencode = _notConfigured;
00123     return (1);
00124 }
00125 
00126 /************************************************************************/
00127 /*                       TIFFIsCODECConfigured()                        */
00128 /************************************************************************/
00129 
00137 int
00138 TIFFIsCODECConfigured(uint16 scheme)
00139 {
00140     const TIFFCodec* codec = TIFFFindCODEC(scheme);
00141 
00142     if(codec == NULL) {
00143             return 0;
00144         }
00145         if(codec->init == NULL) {
00146             return 0;
00147         }
00148     if(codec->init != NotConfigured){
00149             return 1;
00150         }
00151     return 0;
00152 }
00153 
00154 /*
00155  * Local Variables:
00156  * mode: c
00157  * c-basic-offset: 8
00158  * fill-column: 78
00159  * End:
00160  */

Generated on Sun May 27 2012 04:19:32 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.