SDL2_gfx  1.0.1
GraphicsprimitivesandsurfacefunctionsforSDL2
Defines | Functions
I:/Sources/sdl2gfx/SDL2_imageFilter.h File Reference

Go to the source code of this file.

Defines

#define SDL2_IMAGEFILTER_SCOPE   extern

Functions

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMMXdetect (void)
 MMX detection routine (with override flag).
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXoff (void)
 Disable MMX check for filter functions and and force to use non-MMX C based code.
SDL2_IMAGEFILTER_SCOPE void SDL_imageFilterMMXon (void)
 Enable MMX check for filter functions and use MMX code if available.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Add: D = saturation255(S1 + S2)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mean: D = S1/2 + S2/2.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Sub: D = saturation0(S1 - S2)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using AbsDiff: D = | S1 - S2 |.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Mult: D = saturation255(S1 * S2)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultNor: D = S1 * S2.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby2: D = saturation255(S1/2 * S2)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4 (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using MultDivby4: D = saturation255(S1/2 * S2/2)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitAnd: D = S1 & S2.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using BitOr: D = S1 | S2.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv (unsigned char *Src1, unsigned char *Src2, unsigned char *Dest, unsigned int length)
 Filter using Div: D = S1 / S2.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation (unsigned char *Src1, unsigned char *Dest, unsigned int length)
 Filter using BitNegation: D = !S.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByte: D = saturation255(S + C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using AddByteToHalf: D = saturation255(S/2 + C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using SubByte: D = saturation0(S - C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned int C)
 Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRight: D = saturation0(S >> N)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char C)
 Filter using MultByByte: D = saturation255(S * C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N, unsigned char C)
 Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftByte: D = (S << N)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter using ShiftLeftUint: D = ((uint)S << N)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char N)
 Filter ShiftLeft: D = saturation255(S << N)
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char T)
 Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange (unsigned char *Src1, unsigned char *Dest, unsigned int length, unsigned char Tmin, unsigned char Tmax)
 Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.
SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear (unsigned char *Src, unsigned char *Dest, unsigned int length, int Cmin, int Cmax, int Nmin, int Nmax)
 Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)

Define Documentation

#define SDL2_IMAGEFILTER_SCOPE   extern

Definition at line 50 of file SDL2_imageFilter.h.


Function Documentation

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAbsDiff ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using AbsDiff: D = | S1 - S2 |.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 542 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAdd ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using Add: D = saturation255(S1 + S2)

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 173 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByte ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  C 
)

Filter using AddByte: D = saturation255(S + C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant value to add (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 1791 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddByteToHalf ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  C 
)

Filter using AddByteToHalf: D = saturation255(S/2 + C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 2068 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterAddUint ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned int  C 
)

Filter using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to add (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 1919 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBinarizeUsingThreshold ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  T 
)

Filter using BinarizeUsingThreshold: D = (S >= T) ? 255:0.

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TThe threshold boundary (inclusive).
Returns:
Returns 0 for success or -1 for error.

Definition at line 3534 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitAnd ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using BitAnd: D = S1 & S2.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1278 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitNegation ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length 
)

Filter using BitNegation: D = !S.

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1671 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterBitOr ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using BitOr: D = S1 | S2.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1392 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterClipToRange ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  Tmin,
unsigned char  Tmax 
)

Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
TminLower (inclusive) boundary of the clipping range.
TmaxUpper (inclusive) boundary of the clipping range.
Returns:
Returns 0 for success or -1 for error.

Definition at line 3691 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterDiv ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using Div: D = S1 / S2.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1549 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMean ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using Mean: D = S1/2 + S2/2.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 308 of file SDL2_imageFilter.c.

MMX detection routine (with override flag).

Returns:
1 of MMX was detected, 0 otherwise.

Definition at line 80 of file SDL2_imageFilter.c.

Disable MMX check for filter functions and and force to use non-MMX C based code.

Definition at line 93 of file SDL2_imageFilter.c.

Enable MMX check for filter functions and use MMX code if available.

Definition at line 101 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMult ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using Mult: D = saturation255(S1 * S2)

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 729 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultByByte ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  C 
)

Filter using MultByByte: D = saturation255(S * C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to multiply with (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 2790 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby2 ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using MultDivby2: D = saturation255(S1/2 * S2)

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1000 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultDivby4 ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using MultDivby4: D = saturation255(S1/2 * S2/2)

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 1141 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterMultNor ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using MultNor: D = S1 * S2.

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 862 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterNormalizeLinear ( unsigned char *  Src,
unsigned char *  Dest,
unsigned int  length,
int  Cmin,
int  Cmax,
int  Nmin,
int  Nmax 
)

Filter using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)

Parameters:
SrcPointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CminNormalization constant.
CmaxNormalization constant.
NminNormalization constant.
NmaxNormalization constant.
Returns:
Returns 0 for success or -1 for error.

Definition at line 3909 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeft ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N 
)

Filter ShiftLeft: D = saturation255(S << N)

Parameters:
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
Returns:
Returns 0 for success or -1 for error.

Definition at line 3393 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftByte ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N 
)

Filter using ShiftLeftByte: D = (S << N)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
Returns:
Returns 0 for success or -1 for error.

Definition at line 3093 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftLeftUint ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N 
)

Filter using ShiftLeftUint: D = ((uint)S << N)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
Returns:
Returns 0 for success or -1 for error.

Definition at line 3210 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRight ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N 
)

Filter using ShiftRight: D = saturation0(S >> N)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
Returns:
Returns 0 for success or -1 for error.

Definition at line 2476 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightAndMultByByte ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N,
unsigned char  C 
)

Filter using ShiftRightAndMultByByte: D = saturation255((S >> N) * C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 8.
CConstant to multiply with (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 2943 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterShiftRightUint ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  N 
)

Filter using ShiftRightUint: D = saturation0((uint)S[i] >> N)

Parameters:
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
NNumber of bit-positions to shift (N). Valid range is 0 to 32.
Returns:
Returns 0 for success or -1 for error.

Definition at line 2594 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSub ( unsigned char *  Src1,
unsigned char *  Src2,
unsigned char *  Dest,
unsigned int  length 
)

Filter using Sub: D = saturation0(S1 - S2)

Parameters:
Src1Pointer to the start of the first source byte array (S1).
Src2Pointer to the start of the second source byte array (S2).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
Returns:
Returns 0 for success or -1 for error.

Definition at line 422 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubByte ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned char  C 
)

Filter using SubByte: D = saturation0(S - C)

Parameters:
Src1Pointer to the start of the source byte array (S).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source arrays.
CConstant to subtract (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 2196 of file SDL2_imageFilter.c.

SDL2_IMAGEFILTER_SCOPE int SDL_imageFilterSubUint ( unsigned char *  Src1,
unsigned char *  Dest,
unsigned int  length,
unsigned int  C 
)

Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)

Parameters:
Src1Pointer to the start of the source byte array (S1).
DestPointer to the start of the destination byte array (D).
lengthThe number of bytes in the source array.
CConstant to subtract (C).
Returns:
Returns 0 for success or -1 for error.

Definition at line 2325 of file SDL2_imageFilter.c.