[692] | 1 | //-----------------------------------------------------------------------------
|
---|
| 2 | //
|
---|
| 3 | // ImageLib Sources
|
---|
| 4 | // Copyright (C) 2000-2002 by Denton Woods
|
---|
| 5 | // Last modified: 02/19/2002 <--Y2K Compliant! =]
|
---|
| 6 | //
|
---|
| 7 | // Filename: IL/devil_internal_exports.h
|
---|
| 8 | //
|
---|
| 9 | // Description: Internal stuff for DevIL (IL, ILU and ILUT)
|
---|
| 10 | //
|
---|
| 11 | //-----------------------------------------------------------------------------
|
---|
| 12 |
|
---|
| 13 | #ifndef IL_EXPORTS_H
|
---|
| 14 | #define IL_EXPORTS_H
|
---|
| 15 |
|
---|
| 16 | #include "IL/il.h"
|
---|
| 17 |
|
---|
| 18 | #ifdef __cplusplus
|
---|
| 19 | extern "C" {
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
| 22 | #define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
|
---|
| 23 | #define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
|
---|
| 24 |
|
---|
| 25 |
|
---|
| 26 | // Basic Palette struct
|
---|
| 27 | typedef struct ILpal
|
---|
| 28 | {
|
---|
| 29 | ILubyte* Palette; // the image palette (if any)
|
---|
| 30 | ILuint PalSize; // size of the palette (in bytes)
|
---|
| 31 | ILenum PalType; // the palette types below (0x0500 range)
|
---|
| 32 | } ILpal;
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | // The Fundamental Image struct
|
---|
| 36 | typedef struct ILimage
|
---|
| 37 | {
|
---|
| 38 | ILuint Width; // the image's width
|
---|
| 39 | ILuint Height; // the image's height
|
---|
| 40 | ILuint Depth; // the image's depth
|
---|
| 41 | ILubyte Bpp; // bytes per pixel (now number of channels)
|
---|
| 42 | ILubyte Bpc; // bytes per channel
|
---|
| 43 | ILuint Bps; // bytes per scanline (components for IL)
|
---|
| 44 | ILubyte* Data; // the image data
|
---|
| 45 | ILuint SizeOfData; // the total size of the data (in bytes)
|
---|
| 46 | ILuint SizeOfPlane; // SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
|
---|
| 47 | ILenum Format; // image format (in IL enum style)
|
---|
| 48 | ILenum Type; // image type (in IL enum style)
|
---|
| 49 | ILenum Origin; // origin of the image
|
---|
| 50 | ILpal Pal; // palette details
|
---|
| 51 | ILuint Duration; // length of the time to display this "frame"
|
---|
| 52 | ILenum CubeFlags; // cube map flags for sides present in chain
|
---|
| 53 | struct ILimage* Mipmaps; // mipmapped versions of this image terminated by a NULL - usu. NULL
|
---|
| 54 | struct ILimage* Next; // next image in the chain - usu. NULL
|
---|
| 55 | struct ILimage* Layers; // subsequent layers in the chain - usu. NULL
|
---|
| 56 | ILuint NumNext; // number of images following this one (0 when not parent)
|
---|
| 57 | ILuint NumMips; // number of mipmaps (0 when not parent)
|
---|
| 58 | ILuint NumLayers; // number of layers (0 when not parent)
|
---|
| 59 | ILuint* AnimList; // animation list
|
---|
| 60 | ILuint AnimSize; // animation list size
|
---|
| 61 | ILvoid* Profile; // colour profile
|
---|
| 62 | ILuint ProfileSize; // colour profile size
|
---|
| 63 | ILuint OffX, OffY; // offset of the image
|
---|
| 64 | ILubyte* DxtcData; // compressed data
|
---|
| 65 | ILenum DxtcFormat; // compressed data format
|
---|
| 66 | ILuint DxtcSize; // compressed data size
|
---|
| 67 | } ILimage;
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | // Memory functions
|
---|
| 71 | ILAPI ILvoid* ILAPIENTRY ialloc(ILuint Size);
|
---|
| 72 | ILAPI ILvoid ILAPIENTRY ifree(ILvoid *Ptr);
|
---|
| 73 | ILAPI ILvoid* ILAPIENTRY icalloc(ILuint Size, ILuint Num);
|
---|
| 74 | #ifdef ALTIVEC_GCC
|
---|
| 75 | ILAPI ILvoid* ILAPIENTRY ivec_align_buffer(ILvoid *buffer, ILuint size);
|
---|
| 76 | #include "altivec.h"
|
---|
| 77 | #endif
|
---|
| 78 |
|
---|
| 79 | // Internal library functions in IL
|
---|
| 80 | ILAPI ILimage* ILAPIENTRY ilGetCurImage(ILvoid);
|
---|
| 81 | ILAPI ILvoid ILAPIENTRY ilSetCurImage(ILimage *Image);
|
---|
| 82 | ILAPI ILvoid ILAPIENTRY ilSetError(ILenum Error);
|
---|
| 83 | ILAPI ILvoid ILAPIENTRY ilSetPal(ILpal *Pal);
|
---|
| 84 |
|
---|
| 85 | //
|
---|
| 86 | // Utility functions
|
---|
| 87 | //
|
---|
| 88 | ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
|
---|
| 89 | ILAPI ILenum ILAPIENTRY ilGetFormatBpp(ILubyte Bpp);
|
---|
| 90 | ILAPI ILubyte ILAPIENTRY ilGetBpcType(ILenum Type);
|
---|
| 91 | ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
|
---|
| 92 | ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
|
---|
| 93 | ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
|
---|
| 94 | ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
|
---|
| 95 | ILAPI ILenum ILAPIENTRY ilTypeFromExt(const ILstring FileName);
|
---|
| 96 | ILAPI ILvoid ILAPIENTRY ilReplaceCurImage(ILimage *Image);
|
---|
| 97 |
|
---|
| 98 | //
|
---|
| 99 | // Image functions
|
---|
| 100 | //
|
---|
| 101 | ILAPI ILvoid ILAPIENTRY iBindImageTemp (ILvoid);
|
---|
| 102 | ILAPI ILboolean ILAPIENTRY ilClearImage_ (ILimage *Image);
|
---|
| 103 | ILAPI ILvoid ILAPIENTRY ilCloseImage (ILimage *Image);
|
---|
| 104 | ILAPI ILvoid ILAPIENTRY ilClosePal (ILpal *Palette);
|
---|
| 105 | ILAPI ILpal* ILAPIENTRY iCopyPal (ILvoid);
|
---|
| 106 | ILAPI ILboolean ILAPIENTRY ilCopyImageAttr (ILimage *Dest, ILimage *Src);
|
---|
| 107 | ILAPI ILimage* ILAPIENTRY ilCopyImage_ (ILimage *Src);
|
---|
| 108 | ILAPI ILvoid ILAPIENTRY ilGetClear (ILvoid *Colours, ILenum Format, ILenum Type);
|
---|
| 109 | ILAPI ILuint ILAPIENTRY ilGetCurName (ILvoid);
|
---|
| 110 | ILAPI ILboolean ILAPIENTRY ilIsValidPal (ILpal *Palette);
|
---|
| 111 | ILAPI ILimage* ILAPIENTRY ilNewImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
|
---|
| 112 | ILAPI ILimage* ILAPIENTRY ilNewImageFull (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
|
---|
| 113 | ILAPI ILboolean ILAPIENTRY ilInitImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
|
---|
| 114 | ILAPI ILboolean ILAPIENTRY ilResizeImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
|
---|
| 115 | ILAPI ILboolean ILAPIENTRY ilTexImage_ (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data);
|
---|
| 116 | ILAPI ILboolean ILAPIENTRY ilTexSubImage_ (ILimage *Image, ILvoid *Data);
|
---|
| 117 | ILAPI ILvoid* ILAPIENTRY ilConvertBuffer (ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILvoid *Buffer);
|
---|
| 118 | ILAPI ILimage* ILAPIENTRY iConvertImage (ILimage *Image, ILenum DestFormat, ILenum DestType);
|
---|
| 119 | ILAPI ILpal* ILAPIENTRY iConvertPal (ILpal *Pal, ILenum DestFormat);
|
---|
| 120 | ILAPI ILubyte* ILAPIENTRY iGetFlipped (ILimage *Image);
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 | // Internal library functions in ILU
|
---|
| 124 | ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
|
---|
| 125 | ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
|
---|
| 126 | ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
|
---|
| 127 |
|
---|
| 128 | #ifdef __cplusplus
|
---|
| 129 | }
|
---|
| 130 | #endif
|
---|
| 131 |
|
---|
| 132 | #endif//IL_EXPORTS_H
|
---|