Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

162 wiersze
6.8 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2009 by Denton Woods
  5. // Last modified: 01/06/2009
  6. //
  7. // Filename: IL/devil_internal_exports.h
  8. //
  9. // Description: Internal stuff for DevIL (IL, ILU and ILUT)
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef IL_EXPORTS_H
  13. #define IL_EXPORTS_H
  14. #include "IL/il.h"
  15. #ifdef DEBUG
  16. #include <assert.h>
  17. #else
  18. #define assert(x)
  19. #endif
  20. //#ifndef NOINLINE
  21. #ifndef INLINE
  22. #if defined(__GNUC__)
  23. #define INLINE extern inline
  24. #elif defined(_MSC_VER) //@TODO: Get this working in MSVC++.
  25. // http://www.greenend.org.uk/rjk/2003/03/inline.html
  26. #define NOINLINE
  27. //#define INLINE
  28. /*#ifndef _WIN64 // Cannot use inline assembly in x64 target platform.
  29. #define USE_WIN32_ASM
  30. #endif//_WIN64*/
  31. #define INLINE __inline
  32. #else
  33. #define INLINE inline
  34. #endif
  35. #endif
  36. //#else
  37. //#define INLINE
  38. //#endif //NOINLINE
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #define IL_MAX(a,b) (((a) > (b)) ? (a) : (b))
  43. #define IL_MIN(a,b) (((a) < (b)) ? (a) : (b))
  44. //! Basic Palette struct
  45. typedef struct ILpal
  46. {
  47. ILubyte* Palette; //!< the image palette (if any)
  48. ILuint PalSize; //!< size of the palette (in bytes)
  49. ILenum PalType; //!< the palette types in il.h (0x0500 range)
  50. } ILpal;
  51. //! The Fundamental Image structure
  52. /*! Every bit of information about an image is stored in this internal structure.*/
  53. typedef struct ILimage
  54. {
  55. ILuint Width; //!< the image's width
  56. ILuint Height; //!< the image's height
  57. ILuint Depth; //!< the image's depth
  58. ILubyte Bpp; //!< bytes per pixel (now number of channels)
  59. ILubyte Bpc; //!< bytes per channel
  60. ILuint Bps; //!< bytes per scanline (components for IL)
  61. ILubyte* Data; //!< the image data
  62. ILuint SizeOfData; //!< the total size of the data (in bytes)
  63. ILuint SizeOfPlane; //!< SizeOfData in a 2d image, size of each plane slice in a 3d image (in bytes)
  64. ILenum Format; //!< image format (in IL enum style)
  65. ILenum Type; //!< image type (in IL enum style)
  66. ILenum Origin; //!< origin of the image
  67. ILpal Pal; //!< palette details
  68. ILuint Duration; //!< length of the time to display this "frame"
  69. ILenum CubeFlags; //!< cube map flags for sides present in chain
  70. struct ILimage* Mipmaps; //!< mipmapped versions of this image terminated by a NULL - usu. NULL
  71. struct ILimage* Next; //!< next image in the chain - usu. NULL
  72. struct ILimage* Faces; //!< next cubemap face in the chain - usu. NULL
  73. struct ILimage* Layers; //!< subsequent layers in the chain - usu. NULL
  74. ILuint* AnimList; //!< animation list
  75. ILuint AnimSize; //!< animation list size
  76. void* Profile; //!< colour profile
  77. ILuint ProfileSize; //!< colour profile size
  78. ILuint OffX; //!< x-offset of the image
  79. ILuint OffY; //!< y-offset of the image
  80. ILubyte* DxtcData; //!< compressed data
  81. ILenum DxtcFormat; //!< compressed data format
  82. ILuint DxtcSize; //!< compressed data size
  83. } ILimage;
  84. // Memory functions
  85. ILAPI void* ILAPIENTRY ialloc(const ILsizei Size);
  86. ILAPI void ILAPIENTRY ifree(const void *Ptr);
  87. ILAPI void* ILAPIENTRY icalloc(const ILsizei Size, const ILsizei Num);
  88. #ifdef ALTIVEC_GCC
  89. ILAPI void* ILAPIENTRY ivec_align_buffer(void *buffer, const ILuint size);
  90. #endif
  91. // Internal library functions in IL
  92. ILAPI ILimage* ILAPIENTRY ilGetCurImage(void);
  93. ILAPI void ILAPIENTRY ilSetCurImage(ILimage *Image);
  94. ILAPI void ILAPIENTRY ilSetError(ILenum Error);
  95. ILAPI void ILAPIENTRY ilSetPal(ILpal *Pal);
  96. //
  97. // Utility functions
  98. //
  99. ILAPI ILubyte ILAPIENTRY ilGetBppFormat(ILenum Format);
  100. ILAPI ILenum ILAPIENTRY ilGetFormatBpp(ILubyte Bpp);
  101. ILAPI ILubyte ILAPIENTRY ilGetBpcType(ILenum Type);
  102. ILAPI ILenum ILAPIENTRY ilGetTypeBpc(ILubyte Bpc);
  103. ILAPI ILubyte ILAPIENTRY ilGetBppPal(ILenum PalType);
  104. ILAPI ILenum ILAPIENTRY ilGetPalBaseType(ILenum PalType);
  105. ILAPI ILuint ILAPIENTRY ilNextPower2(ILuint Num);
  106. ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
  107. ILAPI void ILAPIENTRY ilReplaceCurImage(ILimage *Image);
  108. ILAPI void ILAPIENTRY iMemSwap(ILubyte *, ILubyte *, const ILuint);
  109. //
  110. // Image functions
  111. //
  112. ILAPI void ILAPIENTRY iBindImageTemp (void);
  113. ILAPI ILboolean ILAPIENTRY ilClearImage_ (ILimage *Image);
  114. ILAPI void ILAPIENTRY ilCloseImage (ILimage *Image);
  115. ILAPI void ILAPIENTRY ilClosePal (ILpal *Palette);
  116. ILAPI ILpal* ILAPIENTRY iCopyPal (void);
  117. ILAPI ILboolean ILAPIENTRY ilCopyImageAttr (ILimage *Dest, ILimage *Src);
  118. ILAPI ILimage* ILAPIENTRY ilCopyImage_ (ILimage *Src);
  119. ILAPI void ILAPIENTRY ilGetClear (void *Colours, ILenum Format, ILenum Type);
  120. ILAPI ILuint ILAPIENTRY ilGetCurName (void);
  121. ILAPI ILboolean ILAPIENTRY ilIsValidPal (ILpal *Palette);
  122. ILAPI ILimage* ILAPIENTRY ilNewImage (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
  123. ILAPI ILimage* ILAPIENTRY ilNewImageFull (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
  124. ILAPI ILboolean ILAPIENTRY ilInitImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
  125. ILAPI ILboolean ILAPIENTRY ilResizeImage (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc);
  126. ILAPI ILboolean ILAPIENTRY ilTexImage_ (ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data);
  127. ILAPI ILboolean ILAPIENTRY ilTexSubImage_ (ILimage *Image, void *Data);
  128. ILAPI void* ILAPIENTRY ilConvertBuffer (ILuint SizeOfData, ILenum SrcFormat, ILenum DestFormat, ILenum SrcType, ILenum DestType, ILpal *SrcPal, void *Buffer);
  129. ILAPI ILimage* ILAPIENTRY iConvertImage (ILimage *Image, ILenum DestFormat, ILenum DestType);
  130. ILAPI ILpal* ILAPIENTRY iConvertPal (ILpal *Pal, ILenum DestFormat);
  131. ILAPI ILubyte* ILAPIENTRY iGetFlipped (ILimage *Image);
  132. ILAPI ILboolean ILAPIENTRY iMirror();
  133. ILAPI void ILAPIENTRY iFlipBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
  134. ILubyte* iFlipNewBuffer(ILubyte *buff, ILuint depth, ILuint line_size, ILuint line_num);
  135. ILAPI void ILAPIENTRY iGetIntegervImage(ILimage *Image, ILenum Mode, ILint *Param);
  136. // Internal library functions in ILU
  137. ILAPI ILimage* ILAPIENTRY iluRotate_(ILimage *Image, ILfloat Angle);
  138. ILAPI ILimage* ILAPIENTRY iluRotate3D_(ILimage *Image, ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
  139. ILAPI ILimage* ILAPIENTRY iluScale_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth);
  140. #ifdef __cplusplus
  141. }
  142. #endif
  143. #endif//IL_EXPORTS_H