]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
c07d5b2d | 2 | * "$Id: image-sgi.h 177 2006-06-21 00:20:03Z jlovell $" |
ef416fc2 | 3 | * |
4 | * SGI image file format library definitions for the Common UNIX Printing | |
5 | * System (CUPS). | |
6 | * | |
7 | * Copyright 1993-2005 by Easy Software Products. | |
8 | * | |
9 | * These coded instructions, statements, and computer programs are the | |
10 | * property of Easy Software Products and are protected by Federal | |
11 | * copyright law. Distribution and use rights are outlined in the file | |
12 | * "LICENSE.txt" which should have been included with this file. If this | |
13 | * file is missing or damaged please contact Easy Software Products | |
14 | * at: | |
15 | * | |
16 | * Attn: CUPS Licensing Information | |
17 | * Easy Software Products | |
18 | * 44141 Airport View Drive, Suite 204 | |
19 | * Hollywood, Maryland 20636 USA | |
20 | * | |
21 | * Voice: (301) 373-9600 | |
22 | * EMail: cups-info@cups.org | |
23 | * WWW: http://www.cups.org | |
24 | * | |
25 | * This file is subject to the Apple OS-Developed Software exception. | |
26 | */ | |
27 | ||
28 | #ifndef _SGI_H_ | |
29 | # define _SGI_H_ | |
30 | ||
31 | # include <stdio.h> | |
32 | # include <stdlib.h> | |
33 | # include <string.h> | |
34 | ||
35 | # ifdef __cplusplus | |
36 | extern "C" { | |
37 | # endif | |
38 | ||
39 | ||
40 | /* | |
41 | * Constants... | |
42 | */ | |
43 | ||
44 | # define SGI_MAGIC 474 /* Magic number in image file */ | |
45 | ||
46 | # define SGI_READ 0 /* Read from an SGI image file */ | |
47 | # define SGI_WRITE 1 /* Write to an SGI image file */ | |
48 | ||
49 | # define SGI_COMP_NONE 0 /* No compression */ | |
50 | # define SGI_COMP_RLE 1 /* Run-length encoding */ | |
51 | # define SGI_COMP_ARLE 2 /* Agressive run-length encoding */ | |
52 | ||
53 | ||
54 | /* | |
55 | * Image structure... | |
56 | */ | |
57 | ||
58 | typedef struct | |
59 | { | |
60 | FILE *file; /* Image file */ | |
61 | int mode, /* File open mode */ | |
62 | bpp, /* Bytes per pixel/channel */ | |
63 | comp; /* Compression */ | |
64 | unsigned short xsize, /* Width in pixels */ | |
65 | ysize, /* Height in pixels */ | |
66 | zsize; /* Number of channels */ | |
67 | long firstrow, /* File offset for first row */ | |
68 | nextrow, /* File offset for next row */ | |
69 | **table, /* Offset table for compression */ | |
70 | **length; /* Length table for compression */ | |
71 | unsigned short *arle_row; /* Advanced RLE compression buffer */ | |
72 | long arle_offset, /* Advanced RLE buffer offset */ | |
73 | arle_length; /* Advanced RLE buffer length */ | |
74 | } sgi_t; | |
75 | ||
76 | ||
77 | /* | |
78 | * Prototypes... | |
79 | */ | |
80 | ||
81 | extern int sgiClose(sgi_t *sgip); | |
82 | extern int sgiGetRow(sgi_t *sgip, unsigned short *row, int y, int z); | |
83 | extern sgi_t *sgiOpen(const char *filename, int mode, int comp, int bpp, | |
84 | int xsize, int ysize, int zsize); | |
85 | extern sgi_t *sgiOpenFile(FILE *file, int mode, int comp, int bpp, | |
86 | int xsize, int ysize, int zsize); | |
87 | extern int sgiPutRow(sgi_t *sgip, unsigned short *row, int y, int z); | |
88 | ||
89 | # ifdef __cplusplus | |
90 | } | |
91 | # endif | |
92 | #endif /* !_SGI_H_ */ | |
93 | ||
94 | /* | |
c07d5b2d | 95 | * End of "$Id: image-sgi.h 177 2006-06-21 00:20:03Z jlovell $". |
ef416fc2 | 96 | */ |