sdl2/sdl2_gfx

    Dark Mode
Search:
Group by:

Types

FPSmanager {...}{.bycopy.} = object
  framecount*: Uint32
  rateticks*: cfloat
  baseticks*: Uint32
  lastticks*: Uint32
  rate*: Uint32
!
      \brief Structure holding the state and timing information of the framerate controller.

Consts

SDL2gfxPrimitivesStd = false
SDL2gfxPrimitivesGit = false
SDL2gfxPrimitivesDL = true
SDL2gfxPrimitivesStatic = true
SDL2gfxPrimitivesSetVer = ""
SDL2gfxPrimitivesLPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2_gfx/.libs/libSDL2_gfx.a"
SDL2gfxPrimitivesPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2_gfx/SDL2_gfxPrimitives.h"
SDL2_GFXPRIMITIVES_MAJOR = 1
SDL2_GFXPRIMITIVES_MINOR = 0
SDL2_GFXPRIMITIVES_MICRO = 4
SMOOTHING_OFF = 0
SMOOTHING_ON = 1
FPS_UPPER_LIMIT = 200
FPS_LOWER_LIMIT = 1
FPS_DEFAULT = 30

Procs

proc pixelColor(renderer: ptr Renderer; x: Sint16; y: Sint16; color: Uint32): cint {...}{.
    importc, cdecl.}
Note: all ___Color routines expect the color to be in format 0xRRGGBBAA
Pixel
proc pixelRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; r: Uint8; g: Uint8; b: Uint8;
              a: Uint8): cint {...}{.importc, cdecl.}
proc hlineColor(renderer: ptr Renderer; x1: Sint16; x2: Sint16; y: Sint16; color: Uint32): cint {...}{.
    importc, cdecl.}
Horizontal line
proc hlineRGBA(renderer: ptr Renderer; x1: Sint16; x2: Sint16; y: Sint16; r: Uint8;
              g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc vlineColor(renderer: ptr Renderer; x: Sint16; y1: Sint16; y2: Sint16; color: Uint32): cint {...}{.
    importc, cdecl.}
Vertical line
proc vlineRGBA(renderer: ptr Renderer; x: Sint16; y1: Sint16; y2: Sint16; r: Uint8;
              g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc rectangleColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                   y2: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Rectangle
proc rectangleRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                  r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc roundedRectangleColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                          y2: Sint16; rad: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Rounded-Corner Rectangle
proc roundedRectangleRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                         y2: Sint16; rad: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc, cdecl.}
proc boxColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
             color: Uint32): cint {...}{.importc, cdecl.}
Filled rectangle (Box)
proc boxRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
            r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc roundedBoxColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                    y2: Sint16; rad: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Rounded-Corner Filled rectangle (Box)
proc roundedBoxRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                   y2: Sint16; rad: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc, cdecl.}
proc lineColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
              color: Uint32): cint {...}{.importc, cdecl.}
Line
proc lineRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
             r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc aalineColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                color: Uint32): cint {...}{.importc, cdecl.}
AA Line
proc aalineRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
               r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc thickLineColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                   y2: Sint16; width: Uint8; color: Uint32): cint {...}{.importc, cdecl.}
Thick Line
proc thickLineRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                  width: Uint8; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc,
    cdecl.}
proc circleColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; color: Uint32): cint {...}{.
    importc, cdecl.}
Circle
proc circleRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; r: Uint8;
               g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc arcColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; start: Sint16;
             `end`: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Arc
proc arcRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; start: Sint16;
            `end`: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc aacircleColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16;
                  color: Uint32): cint {...}{.importc, cdecl.}
AA Circle
proc aacircleRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; r: Uint8;
                 g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc filledCircleColor(renderer: ptr Renderer; x: Sint16; y: Sint16; r: Sint16;
                      color: Uint32): cint {...}{.importc, cdecl.}
Filled Circle
proc filledCircleRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; r: Uint8;
                     g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc ellipseColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16; ry: Sint16;
                 color: Uint32): cint {...}{.importc, cdecl.}
Ellipse
proc ellipseRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16; ry: Sint16;
                r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc aaellipseColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16; ry: Sint16;
                   color: Uint32): cint {...}{.importc, cdecl.}
AA Ellipse
proc aaellipseRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16; ry: Sint16;
                  r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc filledEllipseColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16;
                       ry: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Filled Ellipse
proc filledEllipseRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rx: Sint16;
                      ry: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc,
    cdecl.}
proc pieColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; start: Sint16;
             `end`: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Pie
proc pieRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16; start: Sint16;
            `end`: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc filledPieColor(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16;
                   start: Sint16; `end`: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Filled Pie
proc filledPieRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; rad: Sint16;
                  start: Sint16; `end`: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc, cdecl.}
proc trigonColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                x3: Sint16; y3: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
Trigon
proc trigonRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
               x3: Sint16; y3: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc, cdecl.}
proc aatrigonColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                  x3: Sint16; y3: Sint16; color: Uint32): cint {...}{.importc, cdecl.}
AA-Trigon
proc aatrigonRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16; y2: Sint16;
                 x3: Sint16; y3: Sint16; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc, cdecl.}
proc filledTrigonColor(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                      y2: Sint16; x3: Sint16; y3: Sint16; color: Uint32): cint {...}{.importc,
    cdecl.}
Filled Trigon
proc filledTrigonRGBA(renderer: ptr Renderer; x1: Sint16; y1: Sint16; x2: Sint16;
                     y2: Sint16; x3: Sint16; y3: Sint16; r: Uint8; g: Uint8; b: Uint8;
                     a: Uint8): cint {...}{.importc, cdecl.}
proc polygonColor(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                 color: Uint32): cint {...}{.importc, cdecl.}
Polygon
proc polygonRGBA(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint; r: Uint8;
                g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc aapolygonColor(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                   color: Uint32): cint {...}{.importc, cdecl.}
AA-Polygon
proc aapolygonRGBA(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                  r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc filledPolygonColor(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                       color: Uint32): cint {...}{.importc, cdecl.}
Filled Polygon
proc filledPolygonRGBA(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                      r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc texturedPolygon(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint;
                    texture: ptr Surface; textureDx: cint; textureDy: cint): cint {...}{.
    importc, cdecl.}
Textured Polygon
proc bezierColor(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint; s: cint;
                color: Uint32): cint {...}{.importc, cdecl.}
Bezier
proc bezierRGBA(renderer: ptr Renderer; vx: ptr Sint16; vy: ptr Sint16; n: cint; s: cint;
               r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc gfxPrimitivesSetFont(fontdata: pointer; cw: Uint32; ch: Uint32) {...}{.importc, cdecl.}
Characters/Strings
proc gfxPrimitivesSetFontRotation(rotation: Uint32) {...}{.importc, cdecl.}
proc characterColor(renderer: ptr Renderer; x: Sint16; y: Sint16; c: cchar; color: Uint32): cint {...}{.
    importc, cdecl.}
proc characterRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; c: cchar; r: Uint8;
                  g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc stringColor(renderer: ptr Renderer; x: Sint16; y: Sint16; s: cstring; color: Uint32): cint {...}{.
    importc, cdecl.}
proc stringRGBA(renderer: ptr Renderer; x: Sint16; y: Sint16; s: cstring; r: Uint8;
               g: Uint8; b: Uint8; a: Uint8): cint {...}{.importc, cdecl.}
proc rotozoomSurface(src: ptr Surface; angle: cdouble; zoom: cdouble; smooth: cint): ptr Surface {...}{.
    importc, cdecl.}
Rotozoom functions
proc rotozoomSurfaceXY(src: ptr Surface; angle: cdouble; zoomx: cdouble; zoomy: cdouble;
                      smooth: cint): ptr Surface {...}{.importc, cdecl.}
proc rotozoomSurfaceSize(width: cint; height: cint; angle: cdouble; zoom: cdouble;
                        dstwidth: ptr cint; dstheight: ptr cint) {...}{.importc, cdecl.}
proc rotozoomSurfaceSizeXY(width: cint; height: cint; angle: cdouble; zoomx: cdouble;
                          zoomy: cdouble; dstwidth: ptr cint; dstheight: ptr cint) {...}{.
    importc, cdecl.}
proc zoomSurface(src: ptr Surface; zoomx: cdouble; zoomy: cdouble; smooth: cint): ptr Surface {...}{.
    importc, cdecl.}
Zooming functions
proc zoomSurfaceSize(width: cint; height: cint; zoomx: cdouble; zoomy: cdouble;
                    dstwidth: ptr cint; dstheight: ptr cint) {...}{.importc, cdecl.}
proc shrinkSurface(src: ptr Surface; factorx: cint; factory: cint): ptr Surface {...}{.importc,
    cdecl.}
Shrinking functions
proc rotateSurface90Degrees(src: ptr Surface; numClockwiseTurns: cint): ptr Surface {...}{.
    importc, cdecl.}
Specialized rotation functions
proc initFramerate(manager: ptr FPSmanager) {...}{.importc: "SDL_initFramerate", cdecl.}
Functions return 0 or value for sucess and -1 for error
proc setFramerate(manager: ptr FPSmanager; rate: Uint32): cint {...}{.
    importc: "SDL_setFramerate", cdecl.}
proc getFramerate(manager: ptr FPSmanager): cint {...}{.importc: "SDL_getFramerate", cdecl.}
proc getFramecount(manager: ptr FPSmanager): cint {...}{.importc: "SDL_getFramecount", cdecl.}
proc framerateDelay(manager: ptr FPSmanager): Uint32 {...}{.importc: "SDL_framerateDelay",
    cdecl.}
proc imageFilterMMXdetect(): cint {...}{.importc: "SDL_imageFilterMMXdetect", cdecl.}
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 imageFilterMMXoff() {...}{.importc: "SDL_imageFilterMMXoff", cdecl.}
Force use of MMX off (or turn possible use back on)
proc imageFilterMMXon() {...}{.importc: "SDL_imageFilterMMXon", cdecl.}
proc imageFilterAdd(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterAdd", cdecl.}
All routines return:
0   OK
-1   Error (internal error, parameter error)

SDL_imageFilterAdd: D = saturation255(S1 + S2)
proc imageFilterMean(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterMean", cdecl.}
SDL_imageFilterMean: D = S1/2 + S2/2
proc imageFilterSub(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterSub", cdecl.}
SDL_imageFilterSub: D = saturation0(S1 - S2)
proc imageFilterAbsDiff(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar;
                       length: cuint): cint {...}{.importc: "SDL_imageFilterAbsDiff",
    cdecl.}
SDL_imageFilterAbsDiff: D = | S1 - S2 |
proc imageFilterMult(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterMult", cdecl.}
SDL_imageFilterMult: D = saturation(S1 S2)
proc imageFilterMultNor(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar;
                       length: cuint): cint {...}{.importc: "SDL_imageFilterMultNor",
    cdecl.}
SDL_imageFilterMultNor: D = S1 S2   (non-MMX)
proc imageFilterMultDivby2(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar;
                          length: cuint): cint {...}{.
    importc: "SDL_imageFilterMultDivby2", cdecl.}
SDL_imageFilterMultDivby2: D = saturation255(S1/2 S2)
proc imageFilterMultDivby4(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar;
                          length: cuint): cint {...}{.
    importc: "SDL_imageFilterMultDivby4", cdecl.}
SDL_imageFilterMultDivby4: D = saturation255(S1/2 S2/2)
proc imageFilterBitAnd(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterBitAnd", cdecl.}
SDL_imageFilterBitAnd: D = S1 & S2
proc imageFilterBitOr(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterBitOr", cdecl.}
SDL_imageFilterBitOr: D = S1 | S2
proc imageFilterDiv(Src1: ptr cuchar; Src2: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterDiv", cdecl.}
SDL_imageFilterDiv: D = S1 / S2   (non-MMX)
proc imageFilterBitNegation(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint): cint {...}{.
    importc: "SDL_imageFilterBitNegation", cdecl.}
SDL_imageFilterBitNegation: D = !S
proc imageFilterAddByte(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; C: cuchar): cint {...}{.
    importc: "SDL_imageFilterAddByte", cdecl.}
SDL_imageFilterAddByte: D = saturation255(S + C)
proc imageFilterAddUint(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; C: cuint): cint {...}{.
    importc: "SDL_imageFilterAddUint", cdecl.}
SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
proc imageFilterAddByteToHalf(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint;
                             C: cuchar): cint {...}{.
    importc: "SDL_imageFilterAddByteToHalf", cdecl.}
SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
proc imageFilterSubByte(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; C: cuchar): cint {...}{.
    importc: "SDL_imageFilterSubByte", cdecl.}
SDL_imageFilterSubByte: D = saturation0(S - C)
proc imageFilterSubUint(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; C: cuint): cint {...}{.
    importc: "SDL_imageFilterSubUint", cdecl.}
SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
proc imageFilterShiftRight(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; N: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftRight", cdecl.}
SDL_imageFilterShiftRight: D = saturation0(S >> N)
proc imageFilterShiftRightUint(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint;
                              N: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftRightUint", cdecl.}
SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
proc imageFilterMultByByte(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; C: cuchar): cint {...}{.
    importc: "SDL_imageFilterMultByByte", cdecl.}
SDL_imageFilterMultByByte: D = saturation255(S C)
proc imageFilterShiftRightAndMultByByte(Src1: ptr cuchar; Dest: ptr cuchar;
                                       length: cuint; N: cuchar; C: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftRightAndMultByByte", cdecl.}
SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) C)
proc imageFilterShiftLeftByte(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint;
                             N: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftLeftByte", cdecl.}
SDL_imageFilterShiftLeftByte: D = (S << N)
proc imageFilterShiftLeftUint(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint;
                             N: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftLeftUint", cdecl.}
SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
proc imageFilterShiftLeft(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint; N: cuchar): cint {...}{.
    importc: "SDL_imageFilterShiftLeft", cdecl.}
SDL_imageFilterShiftLeft: D = saturation255(S << N)
proc imageFilterBinarizeUsingThreshold(Src1: ptr cuchar; Dest: ptr cuchar;
                                      length: cuint; T: cuchar): cint {...}{.
    importc: "SDL_imageFilterBinarizeUsingThreshold", cdecl.}
SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
proc imageFilterClipToRange(Src1: ptr cuchar; Dest: ptr cuchar; length: cuint;
                           Tmin: cuchar; Tmax: cuchar): cint {...}{.
    importc: "SDL_imageFilterClipToRange", cdecl.}
SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
proc imageFilterNormalizeLinear(Src: ptr cuchar; Dest: ptr cuchar; length: cuint;
                               Cmin: cint; Cmax: cint; Nmin: cint; Nmax: cint): cint {...}{.
    importc: "SDL_imageFilterNormalizeLinear", cdecl.}
SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)(S - Cmin) + Nmin)