]>
git.r.bdr.sh - rbdr/pico-engine/blob - build/Debug/Pico.app/Contents/Frameworks/SDL_gfx.framework/Versions/A/Headers/SDL_imageFilter.h
3 SDL_imageFilter - bytes-image "filter" routines
4 (uses inline x86 MMX optimizations if available)
10 #ifndef _SDL_imageFilter_h
11 #define _SDL_imageFilter_h
13 /* Set up for C function definitions, even when using C++ */
18 /* ------ Function Prototypes ------ */
22 #define DLLINTERFACE __declspec(dllexport)
24 #define DLLINTERFACE __declspec(dllimport)
31 /* 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. */
32 /* 2.) Data that is not within an 8 byte boundary is processed using the C routine. */
33 /* 3.) Convolution routines do not have C routines at this time. */
35 // Detect MMX capability in CPU
36 DLLINTERFACE
int SDL_imageFilterMMXdetect(void);
38 // Force use of MMX off (or turn possible use back on)
39 DLLINTERFACE
void SDL_imageFilterMMXoff(void);
40 DLLINTERFACE
void SDL_imageFilterMMXon(void);
43 // All routines return:
45 // -1 Error (internal error, parameter error)
48 // SDL_imageFilterAdd: D = saturation255(S1 + S2)
49 DLLINTERFACE
int SDL_imageFilterAdd(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
51 // SDL_imageFilterMean: D = S1/2 + S2/2
52 DLLINTERFACE
int SDL_imageFilterMean(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
54 // SDL_imageFilterSub: D = saturation0(S1 - S2)
55 DLLINTERFACE
int SDL_imageFilterSub(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
57 // SDL_imageFilterAbsDiff: D = | S1 - S2 |
58 DLLINTERFACE
int SDL_imageFilterAbsDiff(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
60 // SDL_imageFilterMult: D = saturation(S1 * S2)
61 DLLINTERFACE
int SDL_imageFilterMult(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
63 // SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
64 DLLINTERFACE
int SDL_imageFilterMultNor(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
66 // SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
67 DLLINTERFACE
int SDL_imageFilterMultDivby2(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
,
70 // SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
71 DLLINTERFACE
int SDL_imageFilterMultDivby4(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
,
74 // SDL_imageFilterBitAnd: D = S1 & S2
75 DLLINTERFACE
int SDL_imageFilterBitAnd(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
77 // SDL_imageFilterBitOr: D = S1 | S2
78 DLLINTERFACE
int SDL_imageFilterBitOr(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
80 // SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
81 DLLINTERFACE
int SDL_imageFilterDiv(unsigned char *Src1
, unsigned char *Src2
, unsigned char *Dest
, int length
);
83 // SDL_imageFilterBitNegation: D = !S
84 DLLINTERFACE
int SDL_imageFilterBitNegation(unsigned char *Src1
, unsigned char *Dest
, int length
);
86 // SDL_imageFilterAddByte: D = saturation255(S + C)
87 DLLINTERFACE
int SDL_imageFilterAddByte(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char C
);
89 // SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
90 DLLINTERFACE
int SDL_imageFilterAddUint(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned int C
);
92 // SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
93 DLLINTERFACE
int SDL_imageFilterAddByteToHalf(unsigned char *Src1
, unsigned char *Dest
, int length
,
96 // SDL_imageFilterSubByte: D = saturation0(S - C)
97 DLLINTERFACE
int SDL_imageFilterSubByte(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char C
);
99 // SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
100 DLLINTERFACE
int SDL_imageFilterSubUint(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned int C
);
102 // SDL_imageFilterShiftRight: D = saturation0(S >> N)
103 DLLINTERFACE
int SDL_imageFilterShiftRight(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char N
);
105 // SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
106 DLLINTERFACE
int SDL_imageFilterShiftRightUint(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char N
);
108 // SDL_imageFilterMultByByte: D = saturation255(S * C)
109 DLLINTERFACE
int SDL_imageFilterMultByByte(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char C
);
111 // SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
112 DLLINTERFACE
int SDL_imageFilterShiftRightAndMultByByte(unsigned char *Src1
, unsigned char *Dest
, int length
,
113 unsigned char N
, unsigned char C
);
115 // SDL_imageFilterShiftLeftByte: D = (S << N)
116 DLLINTERFACE
int SDL_imageFilterShiftLeftByte(unsigned char *Src1
, unsigned char *Dest
, int length
,
119 // SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
120 DLLINTERFACE
int SDL_imageFilterShiftLeftUint(unsigned char *Src1
, unsigned char *Dest
, int length
,
123 // SDL_imageFilterShiftLeft: D = saturation255(S << N)
124 DLLINTERFACE
int SDL_imageFilterShiftLeft(unsigned char *Src1
, unsigned char *Dest
, int length
, unsigned char N
);
126 // SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
127 DLLINTERFACE
int SDL_imageFilterBinarizeUsingThreshold(unsigned char *Src1
, unsigned char *Dest
, int length
,
130 // SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
131 DLLINTERFACE
int SDL_imageFilterClipToRange(unsigned char *Src1
, unsigned char *Dest
, int length
,
132 unsigned char Tmin
, unsigned char Tmax
);
134 // SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
135 DLLINTERFACE
int SDL_imageFilterNormalizeLinear(unsigned char *Src1
, unsigned char *Dest
, int length
, int Cmin
,
136 int Cmax
, int Nmin
, int Nmax
);
138 /* !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! */
140 // SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
141 DLLINTERFACE
int SDL_imageFilterConvolveKernel3x3Divide(unsigned char *Src
, unsigned char *Dest
, int rows
,
142 int columns
, signed short *Kernel
, unsigned char Divisor
);
144 // SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
145 DLLINTERFACE
int SDL_imageFilterConvolveKernel5x5Divide(unsigned char *Src
, unsigned char *Dest
, int rows
,
146 int columns
, signed short *Kernel
, unsigned char Divisor
);
148 // SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
149 DLLINTERFACE
int SDL_imageFilterConvolveKernel7x7Divide(unsigned char *Src
, unsigned char *Dest
, int rows
,
150 int columns
, signed short *Kernel
, unsigned char Divisor
);
152 // SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
153 DLLINTERFACE
int SDL_imageFilterConvolveKernel9x9Divide(unsigned char *Src
, unsigned char *Dest
, int rows
,
154 int columns
, signed short *Kernel
, unsigned char Divisor
);
156 // SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
157 DLLINTERFACE
int SDL_imageFilterConvolveKernel3x3ShiftRight(unsigned char *Src
, unsigned char *Dest
, int rows
,
158 int columns
, signed short *Kernel
,
159 unsigned char NRightShift
);
161 // SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
162 DLLINTERFACE
int SDL_imageFilterConvolveKernel5x5ShiftRight(unsigned char *Src
, unsigned char *Dest
, int rows
,
163 int columns
, signed short *Kernel
,
164 unsigned char NRightShift
);
166 // SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
167 DLLINTERFACE
int SDL_imageFilterConvolveKernel7x7ShiftRight(unsigned char *Src
, unsigned char *Dest
, int rows
,
168 int columns
, signed short *Kernel
,
169 unsigned char NRightShift
);
171 // SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
172 DLLINTERFACE
int SDL_imageFilterConvolveKernel9x9ShiftRight(unsigned char *Src
, unsigned char *Dest
, int rows
,
173 int columns
, signed short *Kernel
,
174 unsigned char NRightShift
);
176 // SDL_imageFilterSobelX: Dij = saturation255( ... )
177 DLLINTERFACE
int SDL_imageFilterSobelX(unsigned char *Src
, unsigned char *Dest
, int rows
, int columns
);
179 // SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
180 DLLINTERFACE
int SDL_imageFilterSobelXShiftRight(unsigned char *Src
, unsigned char *Dest
, int rows
, int columns
,
181 unsigned char NRightShift
);
183 // Align/restore stack to 32 byte boundary -- Functionality untested! --
184 DLLINTERFACE
void SDL_imageFilterAlignStack(void);
185 DLLINTERFACE
void SDL_imageFilterRestoreStack(void);
187 /* Ends C function definitions when using C++ */
192 #endif /* _SDL_imageFilter_h */