summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Expand)AuthorAgeFilesLines
* WIP implementation of FutureStream.Dominik Picheta2017-02-091-8/+84
* system/unicode: check for buffer overflows; refs #5284Araq2017-02-081-25/+47
* Implement SSL SNI hostname setting for asyncnet.Dominik Picheta2017-02-081-0/+5
* Add some tests to httpcore related to #5344.Dominik Picheta2017-02-071-0/+7
* cleaned up accept-close-race fix #5279Araq2017-02-072-26/+1
* Merge branch 'accept-close-race-5279' of https://github.com/endragor/Nim into...Araq2017-02-072-21/+50
|\
| * Move checkCloseError to nativesocketsRuslan Mustakov2017-02-072-25/+25
| * Fix Windows accept() to fail future instead of raisingRuslan Mustakov2017-02-013-21/+50
* | reenabled clear test, made clear working (#5323)Arne Döring2017-02-021-2/+5
* | make tests on Windows green under --pedanticAraq2017-02-021-1/+1
|/
* Fixes for upcoming asyncdispatch and ioselectors. (#5309)Eugene Kabanov2017-02-014-30/+34
* Allow .async pragma on methods (#5312)Ruslan Mustakov2017-02-011-2/+2
* deprecated nativesockets.dealloc, use freeAddrInfo instead; fixed stdlib depr...Andreas Rumpf2017-01-305-31/+33
* One more fix for #5290.cheatfate2017-01-281-8/+11
* Merge branch 'fix5290' of https://github.com/cheatfate/Nim into cheatfate-fix...Andreas Rumpf2017-01-275-57/+67
|\
| * Fix mistakecheatfate2017-01-271-2/+2
| * asyncdispatch exception memory leaks fixes.cheatfate2017-01-271-4/+9
| * Fix #5290.cheatfate2017-01-274-53/+58
* | make segfaults compilation robust on WindowsAraq2017-01-271-1/+1
|/
* Added heapqueue.del (#5289)Yuriy Glukhov2017-01-271-11/+35
* oops.cheatfate2017-01-261-0/+1
* Fix changes table must be SharedArray when hasThreadSupport.cheatfate2017-01-261-13/+50
* memory tracker is aware of threads (still not threadsafe though)Andreas Rumpf2017-01-261-5/+15
* added default param to strtabs.getOrDefault (#5280)David Krause2017-01-261-2/+2
* Add volatile load/store (#5263)Jeff Ciesielski2017-01-251-0/+30
* Use onThreadCreation to set default SSL context for each thread (#5265)Ruslan Mustakov2017-01-231-5/+8
* Merge pull request #5250 from yglukhov/http-redirectDominik Picheta2017-01-211-18/+30
|\
| * Fixed query and anchor during relative redirectionYuriy Glukhov2017-01-201-0/+2
| * Redirects support in request procYuriy Glukhov2017-01-191-18/+28
* | Merge pull request #5255 from enthus1ast/develDominik Picheta2017-01-211-0/+45
|\ \
| * | more isAbsolute tests for uri.nimenthus1ast2017-01-211-4/+32
| * | added protocol-relative test to uri.nimenthus1ast2017-01-211-1/+3
| * | added isAbsolute to uri.nimenthus1ast2017-01-201-0/+15
| |/
* | fixed bug when the first random(max: float) call is the same value, regardles...Vladar42017-01-201-0/+1
* | new segfaults.nim stdlib module works on WindowsAraq2017-01-201-4/+38
* | first implementation of segfaults stdlib moduleAndreas Rumpf2017-01-201-0/+54
|/
* Import ospaths instead of include (#5233)Yuriy Glukhov2017-01-182-12/+14
* Fix nativesockets.select()Loris Pederiva2017-01-181-7/+30
* re additions for buffer (cstring) RE matching (#5117)jlp7652017-01-161-1/+1
* Fix #5128, #5184. (#5214)Eugene Kabanov2017-01-165-376/+550
* Fixed Mersenne Twister (#5227)MednauN2017-01-161-2/+2
* Workaround for the high cpu usage issue in coroutines on linux (#5186)Dmitriy Fomichev2017-01-111-3/+3
* Improve & optimize strutils 'find' procs (#5196)Parashurama2017-01-111-15/+49
* Fix for #5134 (parseJson(string) should fail on leftover data) (#5203)Lolo Iccl2017-01-111-0/+18
* random.shuffle now takes an openArray procAndreas Rumpf2017-01-111-2/+7
* Documented `shuffle` from `random` module (#5204)Benjamin Summerton2017-01-111-0/+1
* asynchttpserver: import json in the example codeLuke Diamand2017-01-101-0/+1
* make random.nim work for the JS target againAraq2017-01-081-2/+4
* random.nim: added shuffle proc; fixes 'mod' biasAraq2017-01-081-2/+12
* fixes #5179Araq2017-01-071-4/+5
pan> # import sdl when defined(windows): const SDLgfxLibName = "SDL_gfx.dll" elif defined(macosx): const SDLgfxLibName = "libSDL_gfx.dylib" else: const SDLgfxLibName = "libSDL_gfx.so" const # Some rates in Hz FPS_UPPER_LIMIT* = 200 FPS_LOWER_LIMIT* = 1 FPS_DEFAULT* = 30 # ---- Defines SMOOTHING_OFF* = 0 SMOOTHING_ON* = 1 type PFPSmanager* = ptr TFPSmanager TFPSmanager*{.final.} = object # ---- Structures framecount*: Uint32 rateticks*: float32 lastticks*: Uint32 rate*: Uint32 PColorRGBA* = ptr TColorRGBA TColorRGBA*{.final.} = object r*: Uint8 g*: Uint8 b*: Uint8 a*: Uint8 PColorY* = ptr TColorY TColorY*{.final.} = object # # # SDL_framerate: framerate manager # # LGPL (c) A. Schiffler # # y*: Uint8 proc SDL_initFramerate*(manager: PFPSmanager){.cdecl, importc, dynlib: SDLgfxLibName.} proc SDL_setFramerate*(manager: PFPSmanager, rate: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc SDL_getFramerate*(manager: PFPSmanager): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc SDL_framerateDelay*(manager: PFPSmanager){.cdecl, importc, dynlib: SDLgfxLibName.} # # # SDL_gfxPrimitives: graphics primitives for SDL # # LGPL (c) A. Schiffler # # # Note: all ___Color routines expect the color to be in format 0xRRGGBBAA # Pixel proc pixelColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, color: Uint32): int{. cdecl, importc, dynlib: SDLgfxLibName.} proc pixelRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Horizontal line proc hlineColor*(dst: PSDL_Surface, x1: Sint16, x2: Sint16, y: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc hlineRGBA*(dst: PSDL_Surface, x1: Sint16, x2: Sint16, y: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Vertical line proc vlineColor*(dst: PSDL_Surface, x: Sint16, y1: Sint16, y2: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc vlineRGBA*(dst: PSDL_Surface, x: Sint16, y1: Sint16, y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Rectangle proc rectangleColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc rectangleRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. cdecl, importc, dynlib: SDLgfxLibName.} # Filled rectangle (Box) proc boxColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc boxRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Line proc lineColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc lineRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # AA Line proc aalineColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc aalineRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. cdecl, importc, dynlib: SDLgfxLibName.} # Circle proc circleColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, r: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc circleRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # AA Circle proc aacircleColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, r: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc aacircleRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Filled Circle proc filledCircleColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, r: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc filledCircleRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Ellipse proc ellipseColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc ellipseRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. cdecl, importc, dynlib: SDLgfxLibName.} # AA Ellipse proc aaellipseColor*(dst: PSDL_Surface, xc: Sint16, yc: Sint16, rx: Sint16, ry: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc aaellipseRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. cdecl, importc, dynlib: SDLgfxLibName.} # Filled Ellipse proc filledEllipseColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc filledEllipseRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. cdecl, importc, dynlib: SDLgfxLibName.} # Pie proc pieColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, finish: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc pieRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, finish: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Filled Pie proc filledPieColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, finish: Sint16, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc filledPieRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, finish: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Trigon proc trigonColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, color: Uint32): int{. cdecl, importc, dynlib: SDLgfxLibName.} proc trigonRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # AA-Trigon proc aatrigonColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, color: Uint32): int{. cdecl, importc, dynlib: SDLgfxLibName.} proc aatrigonRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Filled Trigon proc filledTrigonColor*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, color: Uint32): int{. cdecl, importc, dynlib: SDLgfxLibName.} proc filledTrigonRGBA*(dst: PSDL_Surface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Polygon proc polygonColor*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc polygonRGBA*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # AA-Polygon proc aapolygonColor*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc aapolygonRGBA*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Filled Polygon proc filledPolygonColor*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc filledPolygonRGBA*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Bezier # s = number of steps proc bezierColor*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, s: int, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc bezierRGBA*(dst: PSDL_Surface, vx: PSint16, vy: PSint16, n: int, s: int, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Characters/Strings proc characterColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, c: char, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc characterRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, c: char, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc stringColor*(dst: PSDL_Surface, x: Sint16, y: Sint16, c: cstring, color: Uint32): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc stringRGBA*(dst: PSDL_Surface, x: Sint16, y: Sint16, c: cstring, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc, dynlib: SDLgfxLibName.} proc gfxPrimitivesSetFont*(fontdata: Pointer, cw: int, ch: int){.cdecl, importc, dynlib: SDLgfxLibName.} # # # SDL_imageFilter - bytes-image "filter" routines # (uses inline x86 MMX optimizations if available) # # LGPL (c) A. Schiffler # # # Comments: # 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. # 2.) Data that is not within an 8 byte boundary is processed using the C routine. # 3.) Convolution routines do not have C routines at this time. # Detect MMX capability in CPU proc SDL_imageFilterMMXdetect*(): int{.cdecl, importc, dynlib: SDLgfxLibName.} # Force use of MMX off (or turn possible use back on) proc SDL_imageFilterMMXoff*(){.cdecl, importc, dynlib: SDLgfxLibName.} proc SDL_imageFilterMMXon*(){.cdecl, importc, dynlib: SDLgfxLibName.} # # All routines return: # 0 OK # -1 Error (internal error, parameter error) # # SDL_imageFilterAdd: D = saturation255(S1 + S2) proc SDL_imageFilterAdd*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMean: D = S1/2 + S2/2 proc SDL_imageFilterMean*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterSub: D = saturation0(S1 - S2) proc SDL_imageFilterSub*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterAbsDiff: D = | S1 - S2 | proc SDL_imageFilterAbsDiff*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMult: D = saturation(S1 * S2) proc SDL_imageFilterMult*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMultNor: D = S1 * S2 (non-MMX) proc SDL_imageFilterMultNor*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2) proc SDL_imageFilterMultDivby2*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2) proc SDL_imageFilterMultDivby4*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterBitAnd: D = S1 & S2 proc SDL_imageFilterBitAnd*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterBitOr: D = S1 | S2 proc SDL_imageFilterBitOr*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterDiv: D = S1 / S2 (non-MMX) proc SDL_imageFilterDiv*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterBitNegation: D = !S proc SDL_imageFilterBitNegation*(Src1: cstring, Dest: cstring, len: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterAddByte: D = saturation255(S + C) proc SDL_imageFilterAddByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterAddUint: D = saturation255(S + (uint)C) proc SDL_imageFilterAddUint*(Src1: cstring, Dest: cstring, len: int, C: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C) proc SDL_imageFilterAddByteToHalf*(Src1: cstring, Dest: cstring, len: int, C: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterSubByte: D = saturation0(S - C) proc SDL_imageFilterSubByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterSubUint: D = saturation0(S - (uint)C) proc SDL_imageFilterSubUint*(Src1: cstring, Dest: cstring, len: int, C: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftRight: D = saturation0(S >> N) proc SDL_imageFilterShiftRight*(Src1: cstring, Dest: cstring, len: int, N: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N) proc SDL_imageFilterShiftRightUint*(Src1: cstring, Dest: cstring, len: int, N: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterMultByByte: D = saturation255(S * C) proc SDL_imageFilterMultByByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C) proc SDL_imageFilterShiftRightAndMultByByte*(Src1: cstring, Dest: cstring, len: int, N: char, C: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftLeftByte: D = (S << N) proc SDL_imageFilterShiftLeftByte*(Src1: cstring, Dest: cstring, len: int, N: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftLeftUint: D = ((uint)S << N) proc SDL_imageFilterShiftLeftUint*(Src1: cstring, Dest: cstring, len: int, N: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterShiftLeft: D = saturation255(S << N) proc SDL_imageFilterShiftLeft*(Src1: cstring, Dest: cstring, len: int, N: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0 proc SDL_imageFilterBinarizeUsingThreshold*(Src1: cstring, Dest: cstring, len: int, T: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0 proc SDL_imageFilterClipToRange*(Src1: cstring, Dest: cstring, len: int, Tmin: int8, Tmax: int8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) proc SDL_imageFilterNormalizeLinear*(Src1: cstring, Dest: cstring, len: int, Cmin: int, Cmax: int, Nmin: int, Nmax: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! # SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel3x3Divide*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel5x5Divide*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel7x7Divide*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel9x9Divide*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel3x3ShiftRight*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel5x5ShiftRight*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel7x7ShiftRight*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... ) proc SDL_imageFilterConvolveKernel9x9ShiftRight*(Src: cstring, Dest: cstring, rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterSobelX: Dij = saturation255( ... ) proc SDL_imageFilterSobelX*(Src: cstring, Dest: cstring, rows: int, columns: int): int{. cdecl, importc, dynlib: SDLgfxLibName.} # SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... ) proc SDL_imageFilterSobelXShiftRight*(Src: cstring, Dest: cstring, rows: int, columns: int, NRightShift: char): int{. cdecl, importc, dynlib: SDLgfxLibName.} # Align/restore stack to 32 byte boundary -- Functionality untested! -- proc SDL_imageFilterAlignStack*(){.cdecl, importc, dynlib: SDLgfxLibName.} proc SDL_imageFilterRestoreStack*(){.cdecl, importc, dynlib: SDLgfxLibName.} # # # SDL_rotozoom - rotozoomer # # LGPL (c) A. Schiffler # # # # # rotozoomSurface() # # Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. # 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1 # then the destination 32bit surface is anti-aliased. If the surface is not 8bit # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. # # proc rotozoomSurface*(src: PSDL_Surface, angle: float64, zoom: float64, smooth: int): PSDL_Surface{.cdecl, importc, dynlib: SDLgfxLibName.} proc rotozoomSurfaceXY*(src: PSDL_Surface, angle: float64, zoomx: float64, zoomy: float64, smooth: int): PSDL_Surface{.cdecl, importc, dynlib: SDLgfxLibName.} # Returns the size of the target surface for a rotozoomSurface() call proc rotozoomSurfaceSize*(width: int, height: int, angle: float64, zoom: float64, dstwidth: var int, dstheight: var int){. cdecl, importc, dynlib: SDLgfxLibName.} proc rotozoomSurfaceSizeXY*(width: int, height: int, angle: float64, zoomx: float64, zoomy: float64, dstwidth: var int, dstheight: var int){.cdecl, importc, dynlib: SDLgfxLibName.} # # # zoomSurface() # # Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. # 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1 # then the destination 32bit surface is anti-aliased. If the surface is not 8bit # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. # # proc zoomSurface*(src: PSDL_Surface, zoomx: float64, zoomy: float64, smooth: int): PSDL_Surface{. cdecl, importc, dynlib: SDLgfxLibName.} # Returns the size of the target surface for a zoomSurface() call proc zoomSurfaceSize*(width: int, height: int, zoomx: float64, zoomy: float64, dstwidth: var int, dstheight: var int){.cdecl, importc, dynlib: SDLgfxLibName.} # implementation