00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef PIC_H
00015 #define PIC_H
00016 
00017 #include "il_internal.h"
00018 
00019 #ifdef _MSC_VER
00020 #pragma pack(push, packed_struct, 1)
00021 #endif
00022 typedef struct PIC_HEAD
00023 {
00024    ILint        Magic;                  
00025    ILfloat      Version;                
00026    ILbyte       Comment[80];    
00027    ILbyte       Id[4];                  
00028    ILshort      Width;                  
00029    ILshort      Height;                 
00030    ILfloat      Ratio;                  
00031    ILshort      Fields;                 
00032    ILshort      Padding;                
00033 } IL_PACKSTRUCT PIC_HEAD;
00034 
00035 typedef struct CHANNEL
00036 {
00037         ILubyte Size;
00038         ILubyte Type;
00039         ILubyte Chan;
00040         void    *Next;
00041 } CHANNEL;
00042 #ifdef _MSC_VER
00043 #pragma pack(pop,  packed_struct)
00044 #endif
00045 
00046 
00047 
00048 #define PIC_UNSIGNED_INTEGER    0x00
00049 #define PIC_SIGNED_INTEGER              0x10    // XXX: Not implemented
00050 #define PIC_SIGNED_FLOAT                0x20    // XXX: Not implemented
00051 
00052 
00053 
00054 #define PIC_UNCOMPRESSED                0x00
00055 #define PIC_PURE_RUN_LENGTH             0x01
00056 #define PIC_MIXED_RUN_LENGTH    0x02
00057 
00058 
00059 #define PIC_RED_CHANNEL                 0x80
00060 #define PIC_GREEN_CHANNEL               0x40
00061 #define PIC_BLUE_CHANNEL                0x20
00062 #define PIC_ALPHA_CHANNEL               0x10
00063 #define PIC_SHADOW_CHANNEL              0x08    // XXX: Not implemented
00064 #define PIC_DEPTH_CHANNEL               0x04    // XXX: Not implemented
00065 #define PIC_AUXILIARY_1_CHANNEL 0x02    // XXX: Not implemented
00066 #define PIC_AUXILIARY_2_CHANNEL 0x01    // XXX: Not implemented
00067 
00068 ILboolean iIsValidPic(void);
00069 ILboolean iCheckPic(PIC_HEAD *Header);
00070 ILboolean iLoadPicInternal(void);
00071 ILboolean readScanlines(ILuint *image, ILint width, ILint height, CHANNEL *channel, ILuint alpha);
00072 ILuint    readScanline(ILubyte *scan, ILint width, CHANNEL *channel,  ILint bytes);
00073 ILboolean channelReadRaw(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
00074 ILboolean channelReadPure(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
00075 ILboolean channelReadMixed(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
00076 
00077 
00078 
00079 #endif//PIC_H