pods::...eFilter(3pm)
๐ธ NAME ๐ธ
SDL::GFX::ImageFilter โ image filtering functions ๐
And in case you were wondering where you even are: this is a 3pm page, straight out of the User Contributed Perl Documentation, bestie ๐ซถ (the header up top is a whole mouthful of a package path, but SDL::GFX::ImageFilter is the part that matters).
๐ CATEGORY ๐
TODO, GFX โจ
Not me reading TODO in the official category list ๐ โ but there it is, no cap. GFX is the other half.
๐ METHODS ๐
Okay so this page is long, because it's basically one giant flex of image-filter wrappers ๐ฆ. Every single one, in order, with its signature and the exact CODE: line, because we do not skip. Periodt.
Heads up bestie: each of these is a wrapper with a Perl-side name (gfx_image_...) and a C-side name (SDL_imageFilter...). They're not the same spelling, okay? Some have capital letters in weird places. Do not "fix" them. Copy them exactly.iykyk๐ญ
๐ MMX_detect
int gfx_image_MMX_detect()
CODE:
SDL_imageFilterMMXdetect();
This one's signature is int gfx_image_MMX_detect() and the whole CODE: block is literally just SDL_imageFilterMMXdetect(); โ no OUTPUT: section, no RETVAL handed back to you ๐. It's giving "I'm here, I ran, that's the whole vibe".
๐ MMX_off
void gfx_image_MMX_off()
CODE: SDL_imageFilterMMXoff();
Returns void, does SDL_imageFilterMMXoff(). Short and iconic ๐
๐ MMX_on
void gfx_image_MMX_on()
CODE: SDL_imageFilterMMXon();
Same deal, void gfx_image_MMX_on(), CODE: is SDL_imageFilterMMXon(); โ the on button to the off button above ๐
โจ add
Two unsigned char * sources walking in, one unsigned char * dest walking out ๐ โ Src1, Src2, Dest, and length.
int gfx_image_add(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterAdd(Src1, Src2, Dest, length);
OUTPUT: RETVAL
RETVAL comes back out, so you get the int return, slay โจ
โจ mean
int gfx_image_mean(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterMean(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Same four args, Src1 and Src2 plus Dest plus length, and it's SDL_imageFilterMean under the hood ๐ง
โจ sub
int gfx_image_sub(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterSub(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Yes bestie the Perl method is called sub ๐คก โ it's a method name, not the Perl keyword, and it maps to SDL_imageFilterSub. Src1, Src2, Dest, length, RETVAL out.
โจ abs_diff
int gfx_image_abs_diff(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterAbsDiff(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Four args, SDL_imageFilterAbsDiff, RETVAL returned ๐
โจ mult
int gfx_image_mult(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterMult(Src1, Src2, Dest, length);
OUTPUT: RETVAL
mult, not mult_nor โ this is the plain one, SDL_imageFilterMult ๐
โจ mult_nor
int gfx_image_mult_nor(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterMultNor(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Heads up: the Perl name is lowercase mult_nor but the C name is SDL_imageFilterMultNor with a capital N ๐ญ do not lowercase it, do not camel-case the Perl one. Two different casing universes, both valid.
โจ mult_div_by_2
int gfx_image_mult_div_by_2(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterMultDivby2(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Perl: mult_div_by_2. C: SDL_imageFilterMultDivby2 โ the by is lowercase there ๐ฎโ๐จ keep the underscores and the capitals exactly where they are.
โจ mult_div_by_4
int gfx_image_mult_div_by_4(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterMultDivby4(Src1, Src2, Dest, length);
OUTPUT: RETVAL
The 4 version of the above, SDL_imageFilterMultDivby4 ๐ฅ
โจ bit_and
int gfx_image_bit_and(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterBitAnd(Src1, Src2, Dest, length);
OUTPUT: RETVAL
SDL_imageFilterBitAnd, four args, RETVAL ๐
โจ bit_or
int gfx_image_bit_or(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterBitOr(Src1, Src2, Dest, length);
OUTPUT: RETVAL
SDL_imageFilterBitOr, same shape as its bit_and sibling ๐ซ
โจ div
int gfx_image_div(Src1, Src2, Dest, length)
unsigned char *Src1
unsigned char *Src2
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterDiv(Src1, Src2, Dest, length);
OUTPUT: RETVAL
Src1, Src2, Dest, length โ SDL_imageFilterDiv โ RETVAL ๐ธ
โจ bit_negation
int gfx_image_bit_negation(Src1, Dest, length)
unsigned char *Src1
unsigned char *Dest
int length
CODE: RETVAL = SDL_imageFilterBitNegation(Src1, Dest, length);
OUTPUT: RETVAL
Oh this one's different โ only one source ๐
Src1, Dest, length, no Src2 anywhere. SDL_imageFilterBitNegation it is.
โจ add_byte
int gfx_image_add_byte(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char C
CODE: RETVAL = SDL_imageFilterAddByte(Src1, Dest, length, C);
OUTPUT: RETVAL
Single source plus a scalar: Src1, Dest, length, and C which is an unsigned char โจ
โจ add_uint
int gfx_image_add_uint(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned int C
CODE: RETVAL = SDL_imageFilterAddUint(Src1, Dest, length, C);
OUTPUT: RETVAL
Same shape as add_byte, but C is an unsigned int here, not an unsigned char ๐ do not mix them up, fr fr. C side: SDL_imageFilterAddUint.
โจ add_byte_to_half
int gfx_image_add_byte_to_half(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char C
CODE: RETVAL = SDL_imageFilterAddByteToHalf(Src1, Dest, length, C);
OUTPUT: RETVAL
unsigned char C again, and the C function is SDL_imageFilterAddByteToHalf ๐ฆ
โจ sub_byte
int gfx_image_sub_byte(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char C
CODE: RETVAL = SDL_imageFilterSubByte(Src1, Dest, length, C);
OUTPUT: RETVAL
SDL_imageFilterSubByte, C as unsigned char, RETVAL returned ๐
โจ sub_uint
int gfx_image_sub_uint(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned int C
CODE: RETVAL = SDL_imageFilterSubUint(Src1, Dest, length, C);
OUTPUT: RETVAL
And this one's unsigned int C, C function SDL_imageFilterSubUint ๐
โจ shift_right
int gfx_image_shift_right(Src1, Dest, length, N)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
CODE: RETVAL = SDL_imageFilterShiftRight(Src1, Dest, length, N);
OUTPUT: RETVAL
Fourth arg is named N here, not C, and it's an unsigned char โ SDL_imageFilterShiftRight โญ
โจ shift_right_uint
int gfx_image_shift_right_uint(Src1, Dest, length, N)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
CODE: RETVAL = SDL_imageFilterShiftRightUint(Src1, Dest, length, N);
OUTPUT: RETVAL
Yes, shift_right_uint with the uint in the name, but N is still typed unsigned char in the signature โ that's literally what the page says, so that's what you get ๐
โจ mult_by_byte
int gfx_image_mult_by_byte(Src1, Dest, length, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char C
CODE: RETVAL = SDL_imageFilterMultByByte(Src1, Dest, length, C);
OUTPUT: RETVAL
Scalar arg is C, unsigned char, C function SDL_imageFilterMultByByte ๐
โจ shift_right_and_mult_by_byte
int gfx_image_shift_right_and_mult_by_byte(Src1, Dest, length, N, C)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
unsigned char C
CODE: RETVAL = SDL_imageFilterShiftRightAndMultByByte(Src1, Dest, length, N, C);
OUTPUT: RETVAL
Two scalars bestie!! ๐คฏ N and C, both unsigned char, both passed into SDL_imageFilterShiftRightAndMultByByte. The name is a whole sentence and it ate.
โจ shift_left_byte
int gfx_image_shift_left_byte(Src1, Dest, length, N)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
CODE: RETVAL = SDL_imageFilterShiftLeftByte(Src1, Dest, length, N);
OUTPUT: RETVAL
Perl: shift_left_byte. C: SDL_imageFilterShiftLeftByte. N is unsigned char ๐ง
โจ shift_left_uint
int gfx_image_shift_left_uint(Src1, Dest, length, N)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
CODE: RETVAL = SDL_imageFilterShiftLeftUint(Src1, Dest, length, N);
OUTPUT: RETVAL
SDL_imageFilterShiftLeftUint, and again N is declared unsigned char ๐
โจ shift_left
int gfx_image_shift_left(Src1, Dest, length, N)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char N
CODE: RETVAL = SDL_imageFilterShiftLeft(Src1, Dest, length, N);
OUTPUT: RETVAL
The plain shift_left โ no byte, no uint, just SDL_imageFilterShiftLeft โจ
โจ binarize_using_threshold
int gfx_image_binarize_using_threshold(Src1, Dest, length, T)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char T
CODE: RETVAL = SDL_imageFilterBinarizeUsingThreshold(Src1, Dest, length, T);
OUTPUT: RETVAL
Fourth arg is T this time (not C, not N ๐), unsigned char, C side SDL_imageFilterBinarizeUsingThreshold.
โจ clip_to_range
int gfx_image_clip_to_range(Src1, Dest, length, Tmin, Tmax)
unsigned char *Src1
unsigned char *Dest
int length
unsigned char Tmin
unsigned char Tmax
CODE: RETVAL = SDL_imageFilterClipToRange(Src1, Dest, length, Tmin, Tmax);
OUTPUT: RETVAL
Two thresholds, Tmin and Tmax, both unsigned char ๐ and yes, the C name is SDL_imageFilterClipToRange.
โจ normalize_linear
int gfx_image_normalize_linear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax)
unsigned char *Src1
unsigned char *Dest
int length
int Cmin
int Cmax
int Nmin
int Nmax
CODE: RETVAL = SDL_imageFilterNormalizeLinear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax);
OUTPUT: RETVAL
Okay this one's the long arg list and I'm obsessed ๐ญ โ Cmin, Cmax, Nmin, Nmax, and all four are plain int, not unsigned char like the threshold friends above. Do not get cute with the types. SDL_imageFilterNormalizeLinear, RETVAL out ๐
๐ฆ convolve_kernel_3x3_divide
int gfx_image_convolve_kernel_3x3_divide(Src, Dest, rows, columns, Kernel, Divisor)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char Divisor
CODE: RETVAL = SDL_imageFilterConvolveKernel3x3Divide(Src, Dest, rows, columns, Kernel, Divisor);
OUTPUT: RETVAL
Welcome to convolve town, population: complicated ๐ซถ Note the arg names โ it's Src here, not Src1, and there's no length at all. Instead you've got rows, columns, a Sint16 *Kernel (capital S, bestie โ Sint16), and Divisor as an unsigned char.
๐ฆ convolve_kernel_5x5_divide
int gfx_image_convolve_kernel_5x5_divide(Src, Dest, rows, columns, Kernel, Divisor)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char Divisor
CODE: RETVAL = SDL_imageFilterConvolveKernel5x5Divide(Src, Dest, rows, columns, Kernel, Divisor);
OUTPUT: RETVAL
Same six args, same types, SDL_imageFilterConvolveKernel5x5Divide โ the 5x5 is right there in the C name too ๐ฅ
๐ฆ convolve_kernel_7x7_divide
int gfx_image_convolve_kernel_7x7_divide(Src, Dest, rows, columns, Kernel, Divisor)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char Divisor
CODE: RETVAL = SDL_imageFilterConvolveKernel7x7Divide(Src, Dest, rows, columns, Kernel, Divisor);
OUTPUT: RETVAL
Seven-by-seven, Sint16 *Kernel, unsigned char Divisor, RETVAL returned โญ
๐ฆ convolve_kernel_9x9_divide
int gfx_image_convolve_kernel_9x9_divide(Src, Dest, rows, columns, Kernel, Divisor)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char Divisor
CODE: RETVAL = SDL_imageFilterConvolveKernel9x9Divide(Src, Dest, rows, columns, Kernel, Divisor);
OUTPUT: RETVAL
The big one, 9x9, C function SDL_imageFilterConvolveKernel9x9Divide ๐ซ
๐ฆ convolve_kernel_3x3_shift_right
int gfx_image_convolve_kernel_3x3_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char NRightShift
CODE: RETVAL = SDL_imageFilterConvolveKernel3x3ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
OUTPUT: RETVAL
Okay the _shift_right variants swap Divisor for NRightShift (still unsigned char) โ everything else stays: Src, Dest, rows, columns, Sint16 *Kernel ๐ธ
๐ฆ convolve_kernel_5x5_shift_right
int gfx_image_convolve_kernel_5x5_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char NRightShift
CODE: RETVAL = SDL_imageFilterConvolveKernel5x5ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
OUTPUT: RETVAL
SDL_imageFilterConvolveKernel5x5ShiftRight, with the NRightShift in place of the divisor, periodt ๐
๐ฆ convolve_kernel_7x7_shift_right
int gfx_image_convolve_kernel_7x7_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
unsigned char *Src
unsigned char *Dest
int rows
int columns
Sint16 *Kernel
unsigned char NRightShift
CODE: RETVAL = SDL_imageFilterConvolveKernel7x7ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
OUTPUT: RETVAL
7x7 version, SDL_imageFilterConvolveKernel7x7ShiftRight, RETVAL comes back out ๐
๐ convolve_kernel_9x9_shift_right
okay so this one is the 9x9 convolution but with a right-shift baked in โ the big sibling energy of the whole kernel family โจ
int gfx_image_convolve_kernel_9x9_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
the args, bestie, in order:
unsigned char *Srcโ your source pixels, the main characters ๐unsigned char *Destโ where the glow-up lands ๐int rowsint columnsSint16 *Kernelโ the 9x9 kernel itself, lowkey the blueprint of the whole vibeunsigned char NRightShiftโ how far right we're shifting, no cap
and the actual lifting:
RETVAL = SDL_imageFilterConvolveKernel9x9ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
OUTPUT: RETVAL โ literally the return value, that's it, that's the output ๐ซถ
๐ธ sobel_x
the Sobel X edge detector!! it's giving "find the vertical edges" and honestly? obsessed ๐
int gfx_image_sobel_x(Src, Dest, rows, columns)
unsigned char *Srcโ pixels in ๐unsigned char *Destโ edges out โจint rowsint columns
the call:
RETVAL = SDL_imageFilterSobelX(Src, Dest, rows, columns);
OUTPUT: RETVAL โ just the return value, periodt ๐
๐ฆ sobel_x_shift_right
same Sobel X energy but with that shift-right twist ๐
int gfx_image_sobel_x_shift_right(Src, Dest, rows, columns, NRightShift)
unsigned char *Srcโ source pixels ๐unsigned char *Destโ destination pixels ๐int rowsint columnsunsigned char NRightShiftโ the right-shift amount, iykyk
the one-liner doing all the work:
RETVAL = SDL_imageFilterSobelXShiftRight(Src, Dest, rows, columns, NRightShift);
OUTPUT: RETVAL โ yep, the return value ๐
๐ง align_stack
no return value, no args, no drama โ it just aligns the stack, bestie ๐ซ
void gfx_image_align_stack()
SDL_imageFilterAlignStack();
(no OUTPUT section here โ because there's literally nothing to output, it's a void function fr fr ๐)
โญ restore_stack
the matching half of align_stack โ puts the stack back the way it was. the way these two ate ๐ซถ
void gfx_image_restore_stack()
SDL_imageFilterRestoreStack();
(also void, also no output, also iconic ๐
)
๐ AUTHORS
See "AUTHORS" in SDL. that's the whole thing, they said go read the SDL AUTHORS file and honestly, respect for keeping it short ๐
and that's the page, bestie!! ๐ source/version vibes: this is pods::...eFilter(3pm) from perl v5.42.0, dated 2024-05-01 โ write that down, cite it in your group chat, slay ๐โจ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms