openilu.pas 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. unit OpenILU;
  2. //------------------------------------------------------------------------------
  3. //
  4. // ImageLib Utility Sources
  5. // Copyright (C) 2000-2002 by Denton Woods
  6. // Last modified: 06/23/2002 <--Y2K Compliant! =]
  7. //
  8. // Filename: il/ilu.h
  9. //
  10. // Description: The main include file for ILU
  11. //
  12. //------------------------------------------------------------------------------
  13. {******************************************************************************}
  14. { Converted to Delphi by Alexander Blach (alexander@abee.de) }
  15. { Version: ILU v1.6.1 }
  16. { Last modified: 06/23/2002 }
  17. {******************************************************************************}
  18. interface
  19. uses
  20. OpenIL,
  21. Windows;
  22. const
  23. ILU_VERSION_1_5_6 = 1;
  24. ILU_VERSION = 156;
  25. ILU_FILTER = $2600;
  26. ILU_NEAREST = $2601;
  27. ILU_LINEAR = $2602;
  28. ILU_BILINEAR = $2603;
  29. ILU_SCALE_BOX = $2604;
  30. ILU_SCALE_TRIANGLE = $2605;
  31. ILU_SCALE_BELL = $2606;
  32. ILU_SCALE_BSPLINE = $2607;
  33. ILU_SCALE_LANCZOS3 = $2608;
  34. ILU_SCALE_MITCHELL = $2609;
  35. // Error types
  36. const
  37. ILU_INVALID_ENUM = $0501;
  38. ILU_OUT_OF_MEMORY = $0502;
  39. ILU_INTERNAL_ERROR = $0504;
  40. ILU_INVALID_VALUE = $0505;
  41. ILU_ILLEGAL_OPERATION = $0506;
  42. ILU_INVALID_PARAM = $0509;
  43. // Values
  44. const
  45. ILU_PLACEMENT = $0700;
  46. ILU_LOWER_LEFT = $0701;
  47. ILU_LOWER_RIGHT = $0702;
  48. ILU_UPPER_LEFT = $0703;
  49. ILU_UPPER_RIGHT = $0704;
  50. ILU_CENTER = $0705;
  51. ILU_CONVOLUTION_MATRIX = $0710;
  52. ILU_VERSION_NUM = $0DE2;
  53. // Filters
  54. const
  55. ILU_FILTER_BLUR = $0803;
  56. ILU_FILTER_GAUSSIAN_3x3 = $0804;
  57. ILU_FILTER_GAUSSIAN_5x5 = $0805;
  58. ILU_FILTER_EMBOSS1 = $0807;
  59. ILU_FILTER_EMBOSS2 = $0808;
  60. ILU_FILTER_LAPLACIAN1 = $080A;
  61. ILU_FILTER_LAPLACIAN2 = $080B;
  62. ILU_FILTER_LAPLACIAN3 = $080C;
  63. ILU_FILTER_LAPLACIAN4 = $080D;
  64. ILU_FILTER_SHARPEN1 = $080E;
  65. ILU_FILTER_SHARPEN2 = $080F;
  66. ILU_FILTER_SHARPEN3 = $0810;
  67. type
  68. PILinfo = ^TILinfo;
  69. TILinfo = record
  70. Id: TILuint; // the image's id
  71. Data: TILuint; // the image's data
  72. Width: TILuint; // the image's width
  73. Height: TILuint; // the image's height
  74. Depth: TILuint; // the image's depth
  75. Bpp: TILubyte; // bytes per pixel (not bits) of the image
  76. SizeOfData: TILuint; // the total size of the data (in bytes)
  77. Format: TILenum; // image format (in IL enum style)
  78. _Type: TILenum; // image type (in IL enum style)
  79. Origin: TILenum; // origin of the image
  80. Palette: PILubyte; // the image's palette
  81. PalType: TILenum; // palette type
  82. PalSize: TILuint; // palette size
  83. CubeFlags: TILenum; // flags for what cube map sides are present
  84. NumNext: TILuint; // number of images following
  85. NumMips: TILuint; // number of mipmaps
  86. NumLayers: TILuint; // number of layers
  87. end;
  88. const
  89. {$IFDEF OPENIL_DEBUG}
  90. ILUDLL = 'ILU-d.DLL';
  91. {$ELSE}
  92. ILUDLL = 'ILU.DLL';
  93. {$ENDIF}
  94. // ImageLib Utility Functions
  95. function iluAlienify: TILboolean; stdcall; external ILUDLL;
  96. function iluBitFilter1: TILboolean; stdcall; external ILUDLL;
  97. function iluBitFilter2: TILboolean; stdcall; external ILUDLL;
  98. function iluBitFilter3: TILboolean; stdcall; external ILUDLL;
  99. function iluBlurAvg(Iter: TILuint): TILboolean; stdcall; external ILUDLL;
  100. function iluBlurGaussian(Iter: TILuint): TILboolean; stdcall; external ILUDLL;
  101. function iluBuildMipmaps: TILboolean; stdcall; external ILUDLL;
  102. function iluColoursUsed: TILuint; stdcall; external ILUDLL;
  103. function iluColorsUsed: TILuint; stdcall; external ILUDLL name 'iluColoursUsed';
  104. function iluCompareImage(Comp: TILuint): TILboolean; stdcall; external ILUDLL;
  105. function iluContrast(Contrast: TILfloat): TILboolean; stdcall; external ILUDLL;
  106. function iluCrop(XOff, YOff, ZOff, Width, Height, Depth: TILuint): TILboolean;
  107. stdcall; external ILUDLL;
  108. procedure iluDeleteImage(Id: TILuint); stdcall; external ILUDLL;
  109. function iluEdgeDetectE: TILboolean; stdcall; external ILUDLL;
  110. function iluEdgeDetectP: TILboolean; stdcall; external ILUDLL;
  111. function iluEdgeDetectS: TILboolean; stdcall; external ILUDLL;
  112. function iluEmboss: TILboolean; stdcall; external ILUDLL;
  113. function iluEnlargeCanvas(Width, Height, Depth: TILuint): TILboolean; stdcall;
  114. external ILUDLL;
  115. function iluEnlargeImage(XDim, YDim, ZDim: TILfloat): TILboolean; stdcall;
  116. external ILUDLL;
  117. function iluEqualize: TILboolean; stdcall; external ILUDLL;
  118. function iluErrorString(Error: TILenum): PChar; stdcall; external ILUDLL;
  119. function iluFlipImage: TILboolean; stdcall; external ILUDLL;
  120. function iluGammaCorrect(Gamma: TILfloat): TILboolean; stdcall; external ILUDLL;
  121. function iluGenImage: TILuint; stdcall; external ILUDLL;
  122. procedure iluGetImageInfo(Info: PILinfo); stdcall; external ILUDLL;
  123. function iluGetInteger(Mode: TILenum): TILint; stdcall; external ILUDLL;
  124. procedure iluGetIntegerv(Mode: TILenum; var Param: TILint); stdcall; external ILUDLL;
  125. function iluGetString(StringName: TILenum): PChar; stdcall; external ILUDLL;
  126. procedure iluImageParameter(PName, Param: TILenum); stdcall; external ILUDLL;
  127. procedure iluInit; stdcall; external ILUDLL;
  128. function iluInvertAlpha: TILboolean; stdcall; external ILUDLL;
  129. function iluLoadImage(FileName: PChar): TILuint; stdcall; external ILUDLL;
  130. function iluMirror: TILboolean; stdcall; external ILUDLL;
  131. function iluNegative: TILboolean; stdcall; external ILUDLL;
  132. function iluNoisify(Factor: TILubyte): TILboolean; stdcall; external ILUDLL;
  133. function iluPixelize(PixSize: TILuint): TILboolean; stdcall; external ILUDLL;
  134. //procedure iluRegionf(ULx, ULy, BRx, BRy: TILfloat); stdcall; external ILUDLL;
  135. //procedure iluRegioni(ULx, ULy, BRx, BRy: TILuint); stdcall; external ILUDLL;
  136. function iluReplaceColour(Red, Green, Blue: TILubyte; Tolerance: TILfloat):
  137. TILboolean; stdcall; external ILUDLL;
  138. function iluReplaceColor(Red, Green, Blue: TILubyte; Tolerance: TILfloat):
  139. TILboolean; stdcall; external ILUDLL name 'iluReplaceColour';
  140. function iluRotate(Angle: TILfloat): TILboolean; stdcall; external ILUDLL;
  141. function iluRotate3D(x, y, z, Angle: TILfloat): TILboolean; stdcall;
  142. external ILUDLL;
  143. function iluSaturate1f(Saturation: TILfloat): TILboolean; stdcall; external ILUDLL;
  144. function iluSaturate4f(r, g, b, Saturation: TILfloat): TILboolean; stdcall;
  145. external ILUDLL;
  146. function iluScale(Width, Height, Depth: TILuint): TILboolean;
  147. stdcall; external ILUDLL;
  148. function iluScaleColours(r, g, b: TILfloat): TILboolean; stdcall; external ILUDLL;
  149. function iluScaleColors(r, g, b: TILfloat): TILboolean; stdcall;
  150. external ILUDLL name 'iluScaleColours';
  151. function iluSharpen(Factor: TILfloat; Iter: TILuint): TILboolean; stdcall; external
  152. ILUDLL;
  153. function iluSwapColours: TILboolean; stdcall; external ILUDLL;
  154. function iluSwapColors: TILboolean; stdcall; external ILUDLL name 'iluSwapColours';
  155. function iluWave(Angle: TILfloat): TILboolean; stdcall; external ILUDLL;
  156. implementation
  157. end.