00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef SGI_H
00015 #define SGI_H
00016 
00017 #include "il_internal.h"
00018 
00019 typedef struct iSgiHeader
00020 {
00021         ILshort         MagicNum;       
00022         ILbyte          Storage;        
00023         ILbyte          Bpc;            
00024         ILushort        Dim;            
00025                                                         
00026                                                         
00027                                                         
00028         
00029         ILushort        XSize;          
00030         ILushort        YSize;          
00031         ILushort        ZSize;          
00032         ILint           PixMin;         
00033         ILint           PixMax;         
00034         ILint           Dummy1;         
00035         ILbyte          Name[80];       
00036         ILint           ColMap;         
00037         ILbyte          Dummy[404];     
00038 } IL_PACKSTRUCT iSgiHeader;
00039 
00040 
00041 #define SGI_VERBATIM            0
00042 #define SGI_RLE                         1
00043 #define SGI_MAGICNUM            474
00044 
00045 
00046 #define SGI_COLMAP_NORMAL       0
00047 #define SGI_COLMAP_DITHERED     1
00048 #define SGI_COLMAP_SCREEN       2
00049 #define SGI_COLMAP_COLMAP       3
00050 
00051 
00052 
00053 ILboolean       iIsValidSgi(void);
00054 ILboolean       iCheckSgi(iSgiHeader *Header);
00055 ILboolean       iLoadSgiInternal(void);
00056 ILboolean       iSaveSgiInternal(void);
00057 void            iExpandScanLine(ILubyte *Dest, ILubyte *Src, ILuint Bpc);
00058 ILint           iGetScanLine(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length);
00059 ILint           iGetScanLineFast(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length, ILubyte*);
00060 void            sgiSwitchData(ILubyte *Data, ILuint SizeOfData);
00061 ILboolean       iNewSgi(iSgiHeader *Head);
00062 ILboolean       iReadNonRleSgi(iSgiHeader *Head);
00063 ILboolean       iReadRleSgi(iSgiHeader *Head);
00064 ILboolean iSaveRleSgi(ILubyte *Data, ILuint w, ILuint h, ILuint numChannels, ILuint bps);
00065 
00066 #endif//SGI_H