sdl_gfx.pas 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit sdl_gfx;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. {
  5. $Id: sdl_gfx.pas,v 1.3 2007/05/29 21:31:04 savage Exp $
  6. }
  7. {
  8. $Log: sdl_gfx.pas,v $
  9. Revision 1.3 2007/05/29 21:31:04 savage
  10. Changes as suggested by Almindor for 64bit compatibility.
  11. Revision 1.2 2007/05/20 20:30:18 savage
  12. Initial Changes to Handle 64 Bits
  13. Revision 1.1 2005/01/03 19:08:32 savage
  14. Header for the SDL_Gfx library.
  15. }
  16. {$I jedi-sdl.inc}
  17. interface
  18. {$IFDEF FPC_DOTTEDUNITS}
  19. uses
  20. {$IFDEF MORPHOS}
  21. Amiga.Core.Exec,
  22. {$ENDIF}
  23. Api.Sdl;
  24. {$ELSE FPC_DOTTEDUNITS}
  25. uses
  26. {$IFDEF MORPHOS}
  27. exec,
  28. {$ENDIF}
  29. sdl;
  30. {$ENDIF FPC_DOTTEDUNITS}
  31. const
  32. {$IFDEF WINDOWS}
  33. SDLgfxLibName = 'SDL_gfx.dll';
  34. {$ENDIF}
  35. {$IFDEF UNIX}
  36. {$IFDEF DARWIN}
  37. SDLgfxLibName = 'libSDL_gfx.dylib';
  38. {$ELSE}
  39. SDLgfxLibName = 'libSDL_gfx.so';
  40. {$ENDIF}
  41. {$ENDIF}
  42. {$IFDEF MACOS}
  43. SDLgfxLibName = 'SDL_gfx';
  44. {$ENDIF}
  45. {$IFDEF MORPHOS}
  46. SDLgfxLibName = 'powersdl_gfx.library';
  47. {$ENDIF}
  48. // Some rates in Hz
  49. FPS_UPPER_LIMIT = 200;
  50. FPS_LOWER_LIMIT = 1;
  51. FPS_DEFAULT = 30;
  52. // ---- Defines
  53. SMOOTHING_OFF = 0;
  54. SMOOTHING_ON = 1;
  55. type
  56. PFPSmanager = ^TFPSmanager;
  57. TFPSmanager = packed record
  58. framecount : Uint32;
  59. rateticks : single;
  60. lastticks : Uint32;
  61. rate : Uint32;
  62. end;
  63. // ---- Structures
  64. PColorRGBA = ^TColorRGBA;
  65. TColorRGBA = packed record
  66. r : Uint8;
  67. g : Uint8;
  68. b : Uint8;
  69. a : Uint8;
  70. end;
  71. PColorY = ^TColorY;
  72. TColorY = packed record
  73. y : Uint8;
  74. end;
  75. {$IFDEF MORPHOS}
  76. {$INCLUDE powersdl_gfx.inc}
  77. {$ELSE MORPHOS}
  78. {
  79. SDL_framerate: framerate manager
  80. LGPL (c) A. Schiffler
  81. }
  82. procedure SDL_initFramerate( manager : PFPSmanager );
  83. cdecl; external {$IFDEF __GPC__}name 'SDL_initFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  84. {$EXTERNALSYM SDL_initFramerate}
  85. function SDL_setFramerate( manager : PFPSmanager; rate : integer ) : integer;
  86. cdecl; external {$IFDEF __GPC__}name 'SDL_setFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  87. {$EXTERNALSYM SDL_setFramerate}
  88. function SDL_getFramerate( manager : PFPSmanager ) : integer;
  89. cdecl; external {$IFDEF __GPC__}name 'SDL_getFramerate'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  90. {$EXTERNALSYM SDL_getFramerate}
  91. procedure SDL_framerateDelay( manager : PFPSmanager );
  92. cdecl; external {$IFDEF __GPC__}name 'SDL_framerateDelay'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  93. {$EXTERNALSYM SDL_framerateDelay}
  94. {
  95. SDL_gfxPrimitives: graphics primitives for SDL
  96. LGPL (c) A. Schiffler
  97. }
  98. // Note: all ___Color routines expect the color to be in format 0xRRGGBBAA
  99. // Pixel
  100. function pixelColor( dst : PSDL_Surface; x : Sint16; y : Sint16; color : Uint32 ) : integer;
  101. cdecl; external {$IFDEF __GPC__}name 'pixelColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  102. {$EXTERNALSYM pixelColor}
  103. function pixelRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  104. cdecl; external {$IFDEF __GPC__}name 'pixelRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  105. {$EXTERNALSYM pixelRGBA}
  106. // Horizontal line
  107. function hlineColor( dst : PSDL_Surface; x1: Sint16; x2 : Sint16; y : Sint16; color : Uint32 ) : integer;
  108. cdecl; external {$IFDEF __GPC__}name 'hlineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  109. {$EXTERNALSYM hlineColor}
  110. function hlineRGBA( dst : PSDL_Surface; x1: Sint16; x2 : Sint16; y : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  111. cdecl; external {$IFDEF __GPC__}name 'hlineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  112. {$EXTERNALSYM hlineRGBA}
  113. // Vertical line
  114. function vlineColor( dst : PSDL_Surface; x : Sint16; y1 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  115. cdecl; external {$IFDEF __GPC__}name 'vlineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  116. {$EXTERNALSYM vlineColor}
  117. function vlineRGBA( dst : PSDL_Surface; x : Sint16; y1 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  118. cdecl; external {$IFDEF __GPC__}name 'vlineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  119. {$EXTERNALSYM vlineRGBA}
  120. // Rectangle
  121. function rectangleColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  122. cdecl; external {$IFDEF __GPC__}name 'rectangleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  123. {$EXTERNALSYM rectangleColor}
  124. function rectangleRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  125. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  126. cdecl; external {$IFDEF __GPC__}name 'rectangleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  127. {$EXTERNALSYM rectangleRGBA}
  128. // Filled rectangle (Box)
  129. function boxColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  130. cdecl; external {$IFDEF __GPC__}name 'boxColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  131. {$EXTERNALSYM boxColor}
  132. function boxRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16;
  133. y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  134. cdecl; external {$IFDEF __GPC__}name 'boxRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  135. {$EXTERNALSYM boxRGBA}
  136. // Line
  137. function lineColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  138. cdecl; external {$IFDEF __GPC__}name 'lineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  139. {$EXTERNALSYM lineColor}
  140. function lineRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  141. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  142. cdecl; external {$IFDEF __GPC__}name 'lineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  143. {$EXTERNALSYM lineRGBA}
  144. // AA Line
  145. function aalineColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; color : Uint32 ) : integer;
  146. cdecl; external {$IFDEF __GPC__}name 'aalineColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  147. {$EXTERNALSYM aalineColor}
  148. function aalineRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16;
  149. x2 : Sint16; y2 : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  150. cdecl; external {$IFDEF __GPC__}name 'aalineRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  151. {$EXTERNALSYM aalineRGBA}
  152. // Circle
  153. function circleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  154. cdecl; external {$IFDEF __GPC__}name 'circleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  155. {$EXTERNALSYM circleColor}
  156. function circleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  157. cdecl; external {$IFDEF __GPC__}name 'circleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  158. {$EXTERNALSYM circleRGBA}
  159. // AA Circle
  160. function aacircleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  161. cdecl; external {$IFDEF __GPC__}name 'aacircleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  162. {$EXTERNALSYM aacircleColor}
  163. function aacircleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  164. rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  165. cdecl; external {$IFDEF __GPC__}name 'aacircleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  166. {$EXTERNALSYM aacircleRGBA}
  167. // Filled Circle
  168. function filledCircleColor( dst : PSDL_Surface; x : Sint16; y : Sint16; r : Sint16; color : Uint32 ) : integer;
  169. cdecl; external {$IFDEF __GPC__}name 'filledCircleColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  170. {$EXTERNALSYM filledCircleColor}
  171. function filledCircleRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  172. rad : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  173. cdecl; external {$IFDEF __GPC__}name 'filledCircleRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  174. {$EXTERNALSYM filledCircleRGBA}
  175. // Ellipse
  176. function ellipseColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  177. cdecl; external {$IFDEF __GPC__}name 'ellipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  178. {$EXTERNALSYM ellipseColor}
  179. function ellipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  180. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  181. cdecl; external {$IFDEF __GPC__}name 'ellipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  182. {$EXTERNALSYM ellipseRGBA}
  183. // AA Ellipse
  184. function aaellipseColor( dst : PSDL_Surface; xc : Sint16; yc : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  185. cdecl; external {$IFDEF __GPC__}name 'aaellipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  186. {$EXTERNALSYM aaellipseColor}
  187. function aaellipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  188. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  189. cdecl; external {$IFDEF __GPC__}name 'aaellipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  190. {$EXTERNALSYM aaellipseRGBA}
  191. // Filled Ellipse
  192. function filledEllipseColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rx : Sint16; ry : Sint16; color : Uint32 ) : integer;
  193. cdecl; external {$IFDEF __GPC__}name 'filledEllipseColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  194. {$EXTERNALSYM filledEllipseColor}
  195. function filledEllipseRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16;
  196. rx : Sint16; ry : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  197. cdecl; external {$IFDEF __GPC__}name 'filledEllipseRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  198. {$EXTERNALSYM filledEllipseRGBA}
  199. // Pie
  200. function pieColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  201. start : Sint16; finish : Sint16; color : Uint32 ) : integer;
  202. cdecl; external {$IFDEF __GPC__}name 'pieColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  203. {$EXTERNALSYM pieColor}
  204. function pieRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  205. start : Sint16; finish : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  206. cdecl; external {$IFDEF __GPC__}name 'pieRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  207. {$EXTERNALSYM pieRGBA}
  208. // Filled Pie
  209. function filledPieColor( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  210. start : Sint16; finish : Sint16; color : Uint32 ) : integer;
  211. cdecl; external {$IFDEF __GPC__}name 'filledPieColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  212. {$EXTERNALSYM filledPieColor}
  213. function filledPieRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; rad : Sint16;
  214. start : Sint16; finish : Sint16; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  215. cdecl; external {$IFDEF __GPC__}name 'filledPieRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  216. {$EXTERNALSYM filledPieRGBA}
  217. // Trigon
  218. function trigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  219. cdecl; external {$IFDEF __GPC__}name 'trigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  220. {$EXTERNALSYM trigonColor}
  221. function trigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  222. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  223. cdecl; external {$IFDEF __GPC__}name 'trigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  224. {$EXTERNALSYM trigonRGBA}
  225. // AA-Trigon
  226. function aatrigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  227. cdecl; external {$IFDEF __GPC__}name 'aatrigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  228. {$EXTERNALSYM aatrigonColor}
  229. function aatrigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  230. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  231. cdecl; external {$IFDEF __GPC__}name 'aatrigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  232. {$EXTERNALSYM aatrigonRGBA}
  233. // Filled Trigon
  234. function filledTrigonColor( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16; color : Uint32 ) : integer;
  235. cdecl; external {$IFDEF __GPC__}name 'filledTrigonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  236. {$EXTERNALSYM filledTrigonColor}
  237. function filledTrigonRGBA( dst : PSDL_Surface; x1 : Sint16; y1 : Sint16; x2 : Sint16; y2 : Sint16; x3 : Sint16; y3 : Sint16;
  238. r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  239. cdecl; external {$IFDEF __GPC__}name 'filledTrigonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  240. {$EXTERNALSYM filledTrigonRGBA}
  241. // Polygon
  242. function polygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  243. cdecl; external {$IFDEF __GPC__}name 'polygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  244. {$EXTERNALSYM polygonColor}
  245. function polygonRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  246. n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  247. cdecl; external {$IFDEF __GPC__}name 'polygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  248. {$EXTERNALSYM polygonRGBA}
  249. // AA-Polygon
  250. function aapolygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  251. cdecl; external {$IFDEF __GPC__}name 'aapolygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  252. {$EXTERNALSYM aapolygonColor}
  253. function aapolygonRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  254. n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  255. cdecl; external {$IFDEF __GPC__}name 'aapolygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  256. {$EXTERNALSYM aapolygonRGBA}
  257. // Filled Polygon
  258. function filledPolygonColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; color : Uint32 ) : integer;
  259. cdecl; external {$IFDEF __GPC__}name 'filledPolygonColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  260. {$EXTERNALSYM filledPolygonColor}
  261. function filledPolygonRGBA( dst : PSDL_Surface; const vx : PSint16;
  262. const vy : PSint16; n : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  263. cdecl; external {$IFDEF __GPC__}name 'filledPolygonRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  264. {$EXTERNALSYM filledPolygonRGBA}
  265. // Bezier
  266. // s = number of steps
  267. function bezierColor( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16; n : integer; s : integer; color : Uint32 ) : integer;
  268. cdecl; external {$IFDEF __GPC__}name 'bezierColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  269. {$EXTERNALSYM bezierColor}
  270. function bezierRGBA( dst : PSDL_Surface; const vx : PSint16; const vy : PSint16;
  271. n : integer; s : integer; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  272. cdecl; external {$IFDEF __GPC__}name 'bezierRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  273. {$EXTERNALSYM bezierRGBA}
  274. // Characters/Strings
  275. function characterColor( dst : PSDL_Surface; x : Sint16; y : Sint16; c : AnsiChar; color : Uint32 ) : integer;
  276. cdecl; external {$IFDEF __GPC__}name 'characterColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  277. {$EXTERNALSYM characterColor}
  278. function characterRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; c : AnsiChar; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  279. cdecl; external {$IFDEF __GPC__}name 'characterRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  280. {$EXTERNALSYM characterRGBA}
  281. function stringColor( dst : PSDL_Surface; x : Sint16; y : Sint16; const c : PAnsiChar; color : Uint32 ) : integer;
  282. cdecl; external {$IFDEF __GPC__}name 'stringColor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  283. {$EXTERNALSYM stringColor}
  284. function stringRGBA( dst : PSDL_Surface; x : Sint16; y : Sint16; const c : PAnsiChar; r : Uint8; g : Uint8; b : Uint8; a : Uint8 ) : integer;
  285. cdecl; external {$IFDEF __GPC__}name 'stringRGBA'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  286. {$EXTERNALSYM stringRGBA}
  287. procedure gfxPrimitivesSetFont(const fontdata : Pointer; cw : integer; ch : integer );
  288. cdecl; external {$IFDEF __GPC__}name 'gfxPrimitivesSetFont'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  289. {$EXTERNALSYM gfxPrimitivesSetFont}
  290. {
  291. SDL_imageFilter - bytes-image "filter" routines
  292. (uses inline x86 MMX optimizations if available)
  293. LGPL (c) A. Schiffler
  294. }
  295. { Comments: }
  296. { 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. }
  297. { 2.) Data that is not within an 8 byte boundary is processed using the C routine. }
  298. { 3.) Convolution routines do not have C routines at this time. }
  299. // Detect MMX capability in CPU
  300. function SDL_imageFilterMMXdetect : integer;
  301. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXdetect'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  302. {$EXTERNALSYM SDL_imageFilterMMXdetect}
  303. // Force use of MMX off (or turn possible use back on)
  304. procedure SDL_imageFilterMMXoff;
  305. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXoff'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  306. {$EXTERNALSYM SDL_imageFilterMMXoff}
  307. procedure SDL_imageFilterMMXon;
  308. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMMXon'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  309. {$EXTERNALSYM SDL_imageFilterMMXon}
  310. //
  311. // All routines return:
  312. // 0 OK
  313. // -1 Error (internal error, parameter error)
  314. //
  315. // SDL_imageFilterAdd: D = saturation255(S1 + S2)
  316. function SDL_imageFilterAdd(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  317. cdecl; external {$IFDEF __GPC__}name 'SDL_imaSDL_imageFilterAddgeFilterMMXon'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  318. {$EXTERNALSYM SDL_imageFilterAdd}
  319. // SDL_imageFilterMean: D = S1/2 + S2/2
  320. function SDL_imageFilterMean(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  321. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMean'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  322. {$EXTERNALSYM SDL_imageFilterMean}
  323. // SDL_imageFilterSub: D = saturation0(S1 - S2)
  324. function SDL_imageFilterSub(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  325. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSub'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  326. {$EXTERNALSYM SDL_imageFilterSub}
  327. // SDL_imageFilterAbsDiff: D = | S1 - S2 |
  328. function SDL_imageFilterAbsDiff(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  329. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAbsDiff'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  330. {$EXTERNALSYM SDL_imageFilterAbsDiff}
  331. // SDL_imageFilterMult: D = saturation(S1 * S2)
  332. function SDL_imageFilterMult(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  333. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMult'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  334. {$EXTERNALSYM SDL_imageFilterMult}
  335. // SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
  336. function SDL_imageFilterMultNor(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  337. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultNor'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  338. {$EXTERNALSYM SDL_imageFilterMultNor}
  339. // SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
  340. function SDL_imageFilterMultDivby2(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar;
  341. length : integer ) : integer;
  342. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultDivby2'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  343. {$EXTERNALSYM SDL_imageFilterMultDivby2}
  344. // SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
  345. function SDL_imageFilterMultDivby4(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar;
  346. length : integer ) : integer;
  347. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultDivby4'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  348. {$EXTERNALSYM SDL_imageFilterMultDivby4}
  349. // SDL_imageFilterBitAnd: D = S1 & S2
  350. function SDL_imageFilterBitAnd(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  351. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitAnd'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  352. {$EXTERNALSYM SDL_imageFilterBitAnd}
  353. // SDL_imageFilterBitOr: D = S1 | S2
  354. function SDL_imageFilterBitOr(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  355. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitOr'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  356. {$EXTERNALSYM SDL_imageFilterBitOr}
  357. // SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
  358. function SDL_imageFilterDiv(Src1 : PAnsiChar; Src2 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  359. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterDiv'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  360. {$EXTERNALSYM SDL_imageFilterDiv}
  361. // SDL_imageFilterBitNegation: D = !S
  362. function SDL_imageFilterBitNegation(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer ) : integer;
  363. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBitNegation'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  364. {$EXTERNALSYM SDL_imageFilterBitNegation}
  365. // SDL_imageFilterAddByte: D = saturation255(S + C)
  366. function SDL_imageFilterAddByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  367. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  368. {$EXTERNALSYM SDL_imageFilterAddByte}
  369. // SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
  370. function SDL_imageFilterAddUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : Cardinal ) : integer;
  371. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  372. {$EXTERNALSYM SDL_imageFilterAddUint}
  373. // SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
  374. function SDL_imageFilterAddByteToHalf(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  375. C : AnsiChar ) : integer;
  376. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAddByteToHalf'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  377. {$EXTERNALSYM SDL_imageFilterAddByteToHalf}
  378. // SDL_imageFilterSubByte: D = saturation0(S - C)
  379. function SDL_imageFilterSubByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  380. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSubByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  381. {$EXTERNALSYM SDL_imageFilterSubByte}
  382. // SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
  383. function SDL_imageFilterSubUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : Cardinal ) : integer;
  384. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSubUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  385. {$EXTERNALSYM SDL_imageFilterSubUint}
  386. // SDL_imageFilterShiftRight: D = saturation0(S >> N)
  387. function SDL_imageFilterShiftRight(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  388. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  389. {$EXTERNALSYM SDL_imageFilterShiftRight}
  390. // SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
  391. function SDL_imageFilterShiftRightUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  392. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRightUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  393. {$EXTERNALSYM SDL_imageFilterShiftRightUint}
  394. // SDL_imageFilterMultByByte: D = saturation255(S * C)
  395. function SDL_imageFilterMultByByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; C : AnsiChar ) : integer;
  396. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterMultByByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  397. {$EXTERNALSYM SDL_imageFilterMultByByte}
  398. // SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
  399. function SDL_imageFilterShiftRightAndMultByByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  400. N : AnsiChar; C : AnsiChar ) : integer;
  401. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftRightAndMultByByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  402. {$EXTERNALSYM SDL_imageFilterShiftRightAndMultByByte}
  403. // SDL_imageFilterShiftLeftByte: D = (S << N)
  404. function SDL_imageFilterShiftLeftByte(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  405. N : AnsiChar ) : integer;
  406. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeftByte'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  407. {$EXTERNALSYM SDL_imageFilterShiftLeftByte}
  408. // SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
  409. function SDL_imageFilterShiftLeftUint(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  410. N : AnsiChar ) : integer;
  411. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeftUint'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  412. {$EXTERNALSYM SDL_imageFilterShiftLeftUint}
  413. // SDL_imageFilterShiftLeft: D = saturation255(S << N)
  414. function SDL_imageFilterShiftLeft(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; N : AnsiChar ) : integer;
  415. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterShiftLeft'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  416. {$EXTERNALSYM SDL_imageFilterShiftLeft}
  417. // SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
  418. function SDL_imageFilterBinarizeUsingThreshold(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  419. T : AnsiChar ) : integer;
  420. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterBinarizeUsingThreshold'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  421. {$EXTERNALSYM SDL_imageFilterBinarizeUsingThreshold}
  422. // SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
  423. function SDL_imageFilterClipToRange(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer;
  424. Tmin : Byte; Tmax : Byte ) : integer;
  425. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterClipToRange'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  426. {$EXTERNALSYM SDL_imageFilterClipToRange}
  427. // SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
  428. function SDL_imageFilterNormalizeLinear(Src1 : PAnsiChar; Dest : PAnsiChar; length : integer; Cmin : integer;
  429. Cmax : integer; Nmin : integer; Nmax : integer ) : integer;
  430. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterClipToRange'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  431. {$EXTERNALSYM SDL_imageFilterClipToRange}
  432. { !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! }
  433. // SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
  434. function SDL_imageFilterConvolveKernel3x3Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  435. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  436. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel3x3Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  437. {$EXTERNALSYM SDL_imageFilterConvolveKernel3x3Divide}
  438. // SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
  439. function SDL_imageFilterConvolveKernel5x5Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  440. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  441. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel5x5Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  442. {$EXTERNALSYM SDL_imageFilterConvolveKernel5x5Divide}
  443. // SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
  444. function SDL_imageFilterConvolveKernel7x7Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  445. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  446. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel7x7Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  447. {$EXTERNALSYM SDL_imageFilterConvolveKernel7x7Divide}
  448. // SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
  449. function SDL_imageFilterConvolveKernel9x9Divide(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  450. columns : integer; Kernel : PShortInt; Divisor : Byte ) : integer;
  451. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel9x9Divide'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  452. {$EXTERNALSYM SDL_imageFilterConvolveKernel9x9Divide}
  453. // SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
  454. function SDL_imageFilterConvolveKernel3x3ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  455. columns : integer; Kernel : PShortInt;
  456. NRightShift : AnsiChar ) : integer;
  457. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel3x3ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  458. {$EXTERNALSYM SDL_imageFilterConvolveKernel3x3ShiftRight}
  459. // SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
  460. function SDL_imageFilterConvolveKernel5x5ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  461. columns : integer; Kernel : PShortInt;
  462. NRightShift : AnsiChar ) : integer;
  463. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel5x5ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  464. {$EXTERNALSYM SDL_imageFilterConvolveKernel5x5ShiftRight}
  465. // SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
  466. function SDL_imageFilterConvolveKernel7x7ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  467. columns : integer; Kernel : PShortInt;
  468. NRightShift : AnsiChar ) : integer;
  469. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel7x7ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  470. {$EXTERNALSYM SDL_imageFilterConvolveKernel7x7ShiftRight}
  471. // SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
  472. function SDL_imageFilterConvolveKernel9x9ShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer;
  473. columns : integer; Kernel : PShortInt;
  474. NRightShift : AnsiChar ) : integer;
  475. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterConvolveKernel9x9ShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  476. {$EXTERNALSYM SDL_imageFilterConvolveKernel9x9ShiftRight}
  477. // SDL_imageFilterSobelX: Dij = saturation255( ... )
  478. function SDL_imageFilterSobelX(Src : PAnsiChar; Dest : PAnsiChar; rows : integer; columns : integer ) : integer;
  479. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSobelX'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  480. {$EXTERNALSYM SDL_imageFilterSobelX}
  481. // SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
  482. function SDL_imageFilterSobelXShiftRight(Src : PAnsiChar; Dest : PAnsiChar; rows : integer; columns : integer;
  483. NRightShift : AnsiChar ) : integer;
  484. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterSobelXShiftRight'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  485. {$EXTERNALSYM SDL_imageFilterSobelXShiftRight}
  486. // Align/restore stack to 32 byte boundary -- Functionality untested! --
  487. procedure SDL_imageFilterAlignStack;
  488. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterAlignStack'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  489. {$EXTERNALSYM SDL_imageFilterAlignStack}
  490. procedure SDL_imageFilterRestoreStack;
  491. cdecl; external {$IFDEF __GPC__}name 'SDL_imageFilterRestoreStack'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  492. {$EXTERNALSYM SDL_imageFilterRestoreStack}
  493. {
  494. SDL_rotozoom - rotozoomer
  495. LGPL (c) A. Schiffler
  496. }
  497. {
  498. rotozoomSurface()
  499. Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  500. 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
  501. then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  502. or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  503. }
  504. function rotozoomSurface( src : PSDL_Surface; angle : double; zoom : double; smooth : integer ) : PSDL_Surface;
  505. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurface'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  506. {$EXTERNALSYM rotozoomSurface}
  507. function rotozoomSurfaceXY( src : PSDL_Surface; angle : double; zoomx : double; zoomy : double; smooth : integer ) : PSDL_Surface;
  508. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceXY'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  509. {$EXTERNALSYM rotozoomSurfaceXY}
  510. { Returns the size of the target surface for a rotozoomSurface() call }
  511. procedure rotozoomSurfaceSize( width : integer; height : integer; angle : double; zoom : double; var dstwidth : integer;
  512. var dstheight : integer );
  513. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceSize'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  514. {$EXTERNALSYM rotozoomSurfaceSize}
  515. procedure rotozoomSurfaceSizeXY
  516. ( width : integer; height : integer; angle : double; zoomx : double; zoomy : double;
  517. var dstwidth : integer; var dstheight : integer );
  518. cdecl; external {$IFDEF __GPC__}name 'rotozoomSurfaceSizeXY'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  519. {$EXTERNALSYM rotozoomSurfaceSizeXY}
  520. {
  521. zoomSurface()
  522. Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  523. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
  524. then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  525. or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  526. }
  527. function zoomSurface(src : PSDL_Surface; zoomx : double; zoomy : double; smooth : integer ) : PSDL_Surface;
  528. cdecl; external {$IFDEF __GPC__}name 'zoomSurface'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  529. {$EXTERNALSYM zoomSurface}
  530. { Returns the size of the target surface for a zoomSurface() call }
  531. procedure zoomSurfaceSize( width : integer; height : integer; zoomx : double; zoomy : double; var dstwidth : integer; var dstheight : integer );
  532. cdecl; external {$IFDEF __GPC__}name 'zoomSurfaceSize'{$ELSE} SDLgfxLibName{$ENDIF __GPC__};
  533. {$EXTERNALSYM zoomSurfaceSize}
  534. {$ENDIF MORPHOS}
  535. implementation
  536. end.