home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / graphics / libtiff_1 / c / tif_codec < prev    next >
Text File  |  1995-10-12  |  3KB  |  100 lines

  1. /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_codec.c,v 1.5 1995/10/10 22:22:44 sam Exp $ */
  2.  
  3. /*
  4.  * Copyright (c) 1988-1995 Sam Leffler
  5.  * Copyright (c) 1991-1995 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.  
  67. /*
  68.  * Compression schemes statically built into the library.
  69.  */
  70. #ifdef VMS
  71. const TIFFCodec _TIFFBuiltinCODECS[] = {
  72. #else
  73. TIFFCodec _TIFFBuiltinCODECS[] = {
  74. #endif
  75.     { "Null",        COMPRESSION_NONE,    TIFFInitDumpMode },
  76.     { "LZW",        COMPRESSION_LZW,    TIFFInitLZW },
  77.     { "PackBits",    COMPRESSION_PACKBITS,    TIFFInitPackBits },
  78.     { "ThunderScan",    COMPRESSION_THUNDERSCAN,TIFFInitThunderScan },
  79.     { "NeXT",        COMPRESSION_NEXT,    TIFFInitNeXT },
  80.     { "JPEG",        COMPRESSION_JPEG,    TIFFInitJPEG },
  81.     { "Old-style JPEG",    COMPRESSION_OJPEG,    TIFFInitOJPEG },
  82.     { "CCITT RLE",    COMPRESSION_CCITTRLE,    TIFFInitCCITTRLE },
  83.     { "CCITT RLE/W",    COMPRESSION_CCITTRLEW,    TIFFInitCCITTRLEW },
  84.     { "CCITT Group3",    COMPRESSION_CCITTFAX3,    TIFFInitCCITTFax3 },
  85.     { "CCITT Group4",    COMPRESSION_CCITTFAX4,    TIFFInitCCITTFax4 },
  86.     { "ISO JBIG",    COMPRESSION_JBIG,    TIFFInitJBIG },
  87.     { "Deflate",    COMPRESSION_DEFLATE,    TIFFInitZIP },
  88.     { NULL },
  89. };
  90.  
  91. static int
  92. NotConfigured(TIFF* tif, int scheme)
  93. {
  94.     const TIFFCodec* c = TIFFFindCODEC(scheme);
  95.     
  96.     TIFFError(tif->tif_name,
  97.         "%s compression support is not configured", c->name);
  98.     return (0);
  99. }
  100.