We don't care about language skills, as long as you can describe it somehow, just give us as much information as you can imagine
As I now know what you mean, here is some shader code to invert an image:
There are about 100 things to improve, and I still don't know if you want to have it in Real-time, if so, you can spare the renderimage rendering and directly render over a sprite to the screen.
You can download my code in the attachments.
For a realtime application, remove following lines:
width = GetImageWidth(image)
height = GetImageHeight(image)
SetSpriteSize(temp,1024,768)
renderimage = CreateRenderImage(width,height,0,0)
SetRenderToImage(renderimage,0)
DrawSprite(temp)
SetRenderToScreen()
DeleteSprite(temp)
...
spr_inverted = CreateSprite(renderimage)
and change
SetSpritePosition(spr_inverted,520,0)
to
SetSpritePosition(temp,520,0)
Please take a look here first:
https://www.appgamekit.com/documentation/guides/13_shaders.htm
You need to know what to do. Instead of an image from the media folder, you can input the camera Image.
Shaders can be complex, you can actually create a whole game inside a shader and direct the input from AppGameKit to it, but they can also help you to make complex operations with no effort.
This is the invert shader:
uniform sampler2D texture0;
varying mediump vec2 uvVarying;
varying mediump vec4 colorVarying;
void main()
{
gl_FragColor = 1.0 -(texture2D(texture0, uvVarying) * colorVarying);
}
If you compare this to the regular sprite .ps shader, you will notice, that I only added a 1.0-(color value mentioned in the manual)
This means the colors in the shader image will become inverted
A memblock operation to invert colors would also be possible, but a lot slower, because you have to go though each byte in each pixel and do (255-bytevalue)
If you do memblock stuff, you are using the CPU, shaders are using the GPU, but they have a strict command set, well that's all.
This is the result of the shader: