Here's my in C++ written "post processing" libary for freebasic.
It enables you to add some image and post proccessing filters to a gfx screen or fb image.
Not all effects are fast enough for games, but some may are useful.
Functions
Code: Select all
gfxFill() faster filling of buffers
gfxCls() faster cls
gfxInvert() invert image by color
gfxGrayscale() grayscales image by avergange RGB
gfxBrightness() adjust brightness (add)
gfxContrast() adjust contrast luminance
gfxEmboss() emboss effect
gfxSephia() warm sepia
gfxSoftGlow() softglow | bloom
gfxColorAnd() masks pixels with given value per and
gfxPruneColor() reduce color by channel shifting
gfxRGBNoise() generates RGB noise
gfxBlur() blur
gfxSharpen() sharpen
gfxSobelGradient() not so perfect sobel
gfxMonochrome() monochrome with dithering
gfxFlipV() flip image vertical ( h axis )
gfxFlipH() flip image horizontal ( v axis )
gfxFlipHV() flip image both axis
gfxNTSC() NTSC old TV filter
Code: Select all
#Include "gfxPostProcess.bi"
screenRes x, y, 32 '32 bit is important
gfxInitEffects() 'gfxInitEffects(imageBuffer) for using on an fb image
do
gfxCls()
'painting stuff
'painting stuff
'when you are finished:
gfxFlipHV() ' or that effect that you want, or more effects at once.
loop
gfxDeInit()
Download
If anybody got some suggestions, please tell me. I would try to implement some more filters. I hope there are no big bugs, but if, then tell me, too :)
bunnX
.