home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / tiff / tif_ccittrle.c < prev    next >
C/C++ Source or Header  |  1993-10-21  |  3KB  |  77 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Header: /usr/people/sam/tiff/libtiff/RCS/tif_ccittrle.c,v 1.14 92/02/10 19:06:10 sam Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Copyright (c) 1988, 1989, 1990, 1991, 1992 Sam Leffler
  7.  * Copyright (c) 1991, 1992 Silicon Graphics, Inc.
  8.  *
  9.  * Permission to use, copy, modify, distribute, and sell this software and 
  10.  * its documentation for any purpose is hereby granted without fee, provided
  11.  * that (i) the above copyright notices and this permission notice appear in
  12.  * all copies of the software and related documentation, and (ii) the names of
  13.  * Sam Leffler and Silicon Graphics may not be used in any advertising or
  14.  * publicity relating to the software without the specific, prior written
  15.  * permission of Sam Leffler and Silicon Graphics.
  16.  * 
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  18.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  19.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  20.  * 
  21.  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  22.  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  23.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  24.  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  25.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  26.  * OF THIS SOFTWARE.
  27.  */
  28.  
  29. /*
  30.  * TIFF Library.
  31.  *
  32.  * CCITT Group 3 1-D Modified Huffman
  33.  * Run Length Encoding Compression Support
  34.  */
  35. #include "tiffioP.h"
  36. #include "tif_fax3.h"
  37.  
  38. TIFFInitCCITTRLE(tif)
  39.     TIFF *tif;
  40. {
  41.     TIFFInitCCITTFax3(tif);        /* reuse G3 compression */
  42.     tif->tif_preencode = NULL;
  43.     tif->tif_postencode = NULL;
  44.     tif->tif_encoderow = TIFFNoRowEncode;
  45.     tif->tif_encodestrip = TIFFNoStripEncode;
  46.     tif->tif_encodetile = TIFFNoTileEncode;
  47.     tif->tif_close = NULL;
  48.     /*
  49.      * This magic causes the regular G3 decompression
  50.      * code to not skip to the EOL mark at the end of
  51.      * a row, and to flush input data to a byte boundary
  52.      * at the end of each row.
  53.      */
  54.     tif->tif_options |= FAX3_NOEOL|FAX3_BYTEALIGN;
  55.     return (1);
  56. }
  57.  
  58. TIFFInitCCITTRLEW(tif)
  59.     TIFF *tif;
  60. {
  61.     TIFFInitCCITTFax3(tif);        /* reuse G3 compression */
  62.     tif->tif_preencode = NULL;
  63.     tif->tif_postencode = NULL;
  64.     tif->tif_encoderow = TIFFNoRowEncode;
  65.     tif->tif_encodestrip = TIFFNoStripEncode;
  66.     tif->tif_encodetile = TIFFNoTileEncode;
  67.     tif->tif_close = NULL;
  68.     /*
  69.      * This magic causes the regular G3 decompression
  70.      * code to not skip to the EOL mark at the end of
  71.      * a row, and to flush input data to a byte boundary
  72.      * at the end of each row.
  73.      */
  74.     tif->tif_options |= FAX3_NOEOL|FAX3_WORDALIGN;
  75.     return (1);
  76. }
  77.