- Main Page
- Data Structures
- Files

# /home/dwoods/DevIL/src-IL/include/il_sgi.h

    00001 //-----------------------------------------------------------------------------
    00002 //
    00003 // ImageLib Sources
    00004 // Copyright (C) 2000-2002 by Denton Woods
    00005 // Last modified: 05/25/2002 <--Y2K Compliant! =]
    00006 //
    00007 // Filename: src-IL/include/sgi.h
    00008 //
    00009 // Description: Reads from and writes to SGI graphics files.
    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;       // IRIS image file magic number
    00022         ILbyte          Storage;        // Storage format
    00023         ILbyte          Bpc;            // Number of bytes per pixel channel
    00024         ILushort        Dim;            // Number of dimensions
    00025                                                         //  1: single channel, 1 row with XSize pixels
    00026                                                         //  2: single channel, XSize*YSize pixels
    00027                                                         //  3: ZSize channels, XSize*YSize pixels
    00028
    00029         ILushort        XSize;          // X size in pixels
    00030         ILushort        YSize;          // Y size in pixels
    00031         ILushort        ZSize;          // Number of channels
    00032         ILint           PixMin;         // Minimum pixel value
    00033         ILint           PixMax;         // Maximum pixel value
    00034         ILint           Dummy1;         // Ignored
    00035         ILbyte          Name[80];       // Image name
    00036         ILint           ColMap;         // Colormap ID
    00037         ILbyte          Dummy[404];     // Ignored
    00038 } IL_PACKSTRUCT iSgiHeader;
    00039
    00040 // Sgi format #define's
    00041 #define SGI_VERBATIM            0
    00042 #define SGI_RLE                         1
    00043 #define SGI_MAGICNUM            474
    00044
    00045 // Sgi colormap types
    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 // Internal functions
    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