home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / sgi / sgi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-07-02  |  2.8 KB  |  101 lines

  1. /*
  2.  * "$Id: sgi.h,v 1.10 1999/06/29 06:15:15 yosh Exp $"
  3.  *
  4.  *   SGI image file format library definitions.
  5.  *
  6.  *   Copyright 1997-1998 Michael Sweet (mike@easysw.com)
  7.  *
  8.  *   This program is free software; you can redistribute it and/or modify it
  9.  *   under the terms of the GNU General Public License as published by the Free
  10.  *   Software Foundation; either version 2 of the License, or (at your option)
  11.  *   any later version.
  12.  *
  13.  *   This program is distributed in the hope that it will be useful, but
  14.  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  15.  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.  *   for more details.
  17.  *
  18.  *   You should have received a copy of the GNU General Public License
  19.  *   along with this program; if not, write to the Free Software
  20.  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21.  *
  22.  * Revision History:
  23.  *
  24.  *   see ChangeLog
  25.  */
  26.  
  27. #ifndef _SGI_H_
  28. #  define _SGI_H_
  29.  
  30. #  include "config.h" 
  31.  
  32. #  include <stdio.h>
  33. #  include <stdlib.h>
  34. #  ifdef HAVE_UNISTD_H
  35. #    include <unistd.h>
  36. #  endif
  37. #  include <string.h>
  38.  
  39. #  ifdef __cplusplus
  40. extern "C" {
  41. #  endif
  42.  
  43.  
  44. /*
  45.  * Constants...
  46.  */
  47.  
  48. #  define SGI_MAGIC    474    /* Magic number in image file */
  49.  
  50. #  define SGI_READ    0    /* Read from an SGI image file */
  51. #  define SGI_WRITE    1    /* Write to an SGI image file */
  52.  
  53. #  define SGI_COMP_NONE    0    /* No compression */
  54. #  define SGI_COMP_RLE    1    /* Run-length encoding */
  55. #  define SGI_COMP_ARLE    2    /* Agressive run-length encoding */
  56.  
  57.  
  58. /*
  59.  * Image structure...
  60.  */
  61.  
  62. typedef struct
  63. {
  64.   FILE            *file;        /* Image file */
  65.   int            mode,        /* File open mode */
  66.             bpp,        /* Bytes per pixel/channel */
  67.             comp;        /* Compression */
  68.   unsigned short    xsize,        /* Width in pixels */
  69.             ysize,        /* Height in pixels */
  70.             zsize;        /* Number of channels */
  71.   long            firstrow,    /* File offset for first row */
  72.             nextrow,    /* File offset for next row */
  73.             **table,    /* Offset table for compression */
  74.             **length;    /* Length table for compression */
  75.   unsigned short    *arle_row;    /* Advanced RLE compression buffer */
  76.   long            arle_offset,    /* Advanced RLE buffer offset */
  77.             arle_length;    /* Advanced RLE buffer length */
  78. } sgi_t;
  79.  
  80.  
  81. /*
  82.  * Prototypes...
  83.  */
  84.  
  85. extern int    sgiClose(sgi_t *sgip);
  86. extern int    sgiGetRow(sgi_t *sgip, unsigned short *row, int y, int z);
  87. extern sgi_t    *sgiOpen(char *filename, int mode, int comp, int bpp,
  88.                  int xsize, int ysize, int zsize);
  89. extern sgi_t    *sgiOpenFile(FILE *file, int mode, int comp, int bpp,
  90.                      int xsize, int ysize, int zsize);
  91. extern int    sgiPutRow(sgi_t *sgip, unsigned short *row, int y, int z);
  92.  
  93. #  ifdef __cplusplus
  94. }
  95. #  endif
  96. #endif /* !_SGI_H_ */
  97.  
  98. /*
  99.  * End of "$Id: sgi.h,v 1.10 1999/06/29 06:15:15 yosh Exp $".
  100.  */
  101.