~ubuntu-branches/ubuntu/hoary/devil/hoary

« back to all changes in this revision

Viewing changes to include/IL/devil_internal_exports.h

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2005-01-03 19:57:42 UTC
  • Revision ID: james.westby@ubuntu.com-20050103195742-4ipkplcwygu3irv0
Tags: upstream-1.6.7
ImportĀ upstreamĀ versionĀ 1.6.7

Show diffs side-by-side

added added

removed removed

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