]> git.ipfire.org Git - thirdparty/cups.git/blame - filter/image-sgi.h
Merge changes from CUPS 1.5.1-r9875.
[thirdparty/cups.git] / filter / image-sgi.h
CommitLineData
ef416fc2 1/*
bc44d920 2 * "$Id: image-sgi.h 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3 *
321d8d57 4 * SGI image file format library definitions for CUPS.
ef416fc2 5 *
321d8d57 6 * Copyright 2007-2011 by Apple Inc.
ef416fc2 7 * Copyright 1993-2005 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
18#ifndef _SGI_H_
19# define _SGI_H_
20
21# include <stdio.h>
22# include <stdlib.h>
23# include <string.h>
24
25# ifdef __cplusplus
26extern "C" {
27# endif
28
29
30/*
31 * Constants...
32 */
33
34# define SGI_MAGIC 474 /* Magic number in image file */
35
36# define SGI_READ 0 /* Read from an SGI image file */
37# define SGI_WRITE 1 /* Write to an SGI image file */
38
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 */
42
43
44/*
45 * Image structure...
46 */
47
48typedef struct
49{
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 */
64} sgi_t;
65
66
67/*
68 * Prototypes...
69 */
70
71extern int sgiClose(sgi_t *sgip);
72extern int sgiGetRow(sgi_t *sgip, unsigned short *row, int y, int z);
73extern sgi_t *sgiOpen(const char *filename, int mode, int comp, int bpp,
74 int xsize, int ysize, int zsize);
75extern sgi_t *sgiOpenFile(FILE *file, int mode, int comp, int bpp,
76 int xsize, int ysize, int zsize);
77extern int sgiPutRow(sgi_t *sgip, unsigned short *row, int y, int z);
78
79# ifdef __cplusplus
80}
81# endif
82#endif /* !_SGI_H_ */
83
84/*
bc44d920 85 * End of "$Id: image-sgi.h 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 86 */