1 /******************************************************************************
2 ** Filename : imageSgi.h
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).
12 ** Date Name Description
13 ** 06/08/99 BRC Initial Release
15 ******************************************************************************/
20 #define IMAGE_SGI_TYPE_VERBATIM 0
21 #define IMAGE_SGI_TYPE_RLE 1
23 struct sImageSgiHeader
// 512 bytes
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)
43 struct sImageSgiHeader header
;
47 #ifndef __IMAGESGI_CPP
49 // RGB image load utility
50 extern struct sImageSgi
*ImageSgiOpen(char const * const fileName
);
51 extern void ImageSgiClose(struct sImageSgi
*image
);
55 #endif /* __IMAGESGI_H */