home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 February / PCWorld_2002-02_cd.bin / Software / Vyzkuste / pdflib / pdflib-4.0.1.sit / pdflib-4.0.1 / tiff / tif_codec.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-04  |  3.7 KB  |  121 lines  |  [TEXT/CWIE]

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