4 * SGI image file format library definitions for CUPS.
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 1993-2005 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * This file is subject to the Apple OS-Developed Software exception.
34 # define SGI_MAGIC 474 /* Magic number in image file */
36 # define SGI_READ 0 /* Read from an SGI image file */
37 # define SGI_WRITE 1 /* Write to an SGI image file */
39 # define SGI_COMP_NONE 0 /* No compression */
40 # define SGI_COMP_RLE 1 /* Run-length encoding */
41 # define SGI_COMP_ARLE 2 /* Agressive run-length encoding */
50 FILE *file; /* Image file */
51 int mode, /* File open mode */
52 bpp, /* Bytes per pixel/channel */
53 comp; /* Compression */
54 unsigned short xsize, /* Width in pixels */
55 ysize, /* Height in pixels */
56 zsize; /* Number of channels */
57 long firstrow, /* File offset for first row */
58 nextrow, /* File offset for next row */
59 **table, /* Offset table for compression */
60 **length; /* Length table for compression */
61 unsigned short *arle_row; /* Advanced RLE compression buffer */
62 long arle_offset, /* Advanced RLE buffer offset */
63 arle_length; /* Advanced RLE buffer length */
71 extern int sgiClose(sgi_t *sgip);
72 extern int sgiGetRow(sgi_t *sgip, unsigned short *row, int y, int z);
73 extern sgi_t *sgiOpen(const char *filename, int mode, int comp, int bpp,
74 int xsize, int ysize, int zsize);
75 extern sgi_t *sgiOpenFile(FILE *file, int mode, int comp, int bpp,
76 int xsize, int ysize, int zsize);
77 extern int sgiPutRow(sgi_t *sgip, unsigned short *row, int y, int z);