jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | ** Filename : imageSgi.h |
| 3 | ** UNCLASSIFIED |
| 4 | ** |
| 5 | ** Description : Utility to read SGI image format files. This code was |
| 6 | ** originally a SGI image loading utility provided with the |
| 7 | ** Mesa 3D library @ http://www.mesa3d.org by Brain Paul. |
| 8 | ** This has been extended to read all SGI image formats |
| 9 | ** (e.g. INT, INTA, RGB, RGBA). |
| 10 | ** |
| 11 | ** Revision History: |
| 12 | ** Date Name Description |
| 13 | ** 06/08/99 BRC Initial Release |
| 14 | ** |
| 15 | ******************************************************************************/ |
| 16 | |
| 17 | #ifndef __IMAGESGI_H |
| 18 | #define __IMAGESGI_H |
| 19 | |
| 20 | #define IMAGE_SGI_TYPE_VERBATIM 0 |
| 21 | #define IMAGE_SGI_TYPE_RLE 1 |
| 22 | |
| 23 | struct sImageSgiHeader // 512 bytes |
| 24 | { |
| 25 | short magic; // IRIS image file magic number (474) |
| 26 | char type; // Storage format (e.g. RLE or VERBATIM) |
| 27 | char numBytesPerPixelChannel; // Number of bytes per pixel channel |
| 28 | unsigned short dim; // Number of dimensions (1 to 3) |
| 29 | unsigned short xsize; // Width (in pixels) |
| 30 | unsigned short ysize; // Height (in pixels) |
| 31 | unsigned short zsize; // Number of channels (1 to 4) |
| 32 | int minimumPixelValue; // Minimum pixel value (0 to 255) |
| 33 | int maximumPixelValue; // Maximum pixel value (0 to 255) |
| 34 | char padding1[4]; // (ignored) |
| 35 | char imageName[80]; // Image name |
| 36 | int colormap; // colormap ID (0=normal, 0=dithered, |
| 37 | // 2=screen, 3=colormap) |
| 38 | char padding2[404]; // (ignored) |
| 39 | }; |
| 40 | |
| 41 | struct sImageSgi |
| 42 | { |
| 43 | struct sImageSgiHeader header; |
| 44 | unsigned char *data; |
| 45 | }; |
| 46 | |
| 47 | #ifndef __IMAGESGI_CPP |
| 48 | |
| 49 | // RGB image load utility |
| 50 | extern struct sImageSgi *ImageSgiOpen(char const * const fileName); |
| 51 | extern void ImageSgiClose(struct sImageSgi *image); |
| 52 | |
| 53 | #endif |
| 54 | |
| 55 | #endif /* __IMAGESGI_H */ |