GLBasic forum

Main forum => GLBasic - en => Topic started by: acristo on 2008-Jul-08

Title: Hue/Saturation of a picture
Post by: acristo on 2008-Jul-08
Is there anyway of changing the hue/sat of picture on GLBasic ?
Technical information bellow.
http://en.wikipedia.org/wiki/Hue (http://en.wikipedia.org/wiki/Hue)
Title: Re: Hue/Saturation of a picture
Post by: Sebastian on 2008-Jul-08
You have 2 ways:

1. read every pixel, change the pixel and write the changed pixel -> to slow for realtime
2. do it via shaders
Title: Re: Hue/Saturation of a picture
Post by: tictac on 2008-Jul-09
Can I apply shaders in a 2D game? (I'm sorry for the question, but I'm a GLBasic beginner!)
Title: Re: Hue/Saturation of a picture
Post by: Kitty Hello on 2008-Jul-09
Yes, of course. All GLBasic commands (on Win32, Mac and Linux) take full advance of the X_SETSHADER command. It's quite stupid that it starts with "X_", though.
Should I change that, maybe?
Title: Re: Hue/Saturation of a picture
Post by: tictac on 2008-Jul-09
Sounds good!

Thank you!
Title: Re: Hue/Saturation of a picture
Post by: acristo on 2008-Jul-09
great thank you.. I don't think you have to change it,now that i know it works for 2d it is fine to me :)
Title: Re: Hue/Saturation of a picture
Post by: tictac on 2008-Jul-09
Hello,

about function name...
I think the only problem is typing it! In fact, even if some functions are self explicative, sometimes they are "hard" to be typed.
Putting a prefix like "x_" is not very keyboard-friendly when one write a big program.
Some languages use "-" (many functional languages do that!), but it is not feasible to every language parser.
Maybe you could use "xSetShader" (even if the language is not case sensitive, it could be more readable than X_SETSHADER).

However, about the function name, if I read "X" I think to something related to "DirectX" (my first approach). But GLBasic does not use DX, so...
(maybe "X" stands for "graphiX" ;-)  )

Ciao!
Title: Re: Hue/Saturation of a picture
Post by: Kitty Hello on 2008-Jul-10
X_ is for "3D eXtension". Anyway.
Oh, where is the "_" on the us keyboard? On a German keayboard it's like writing "M", but only 3 keys further to the right.
Title: Re: Hue/Saturation of a picture
Post by: tictac on 2008-Jul-10
On US keyboard or on Italian keyboards the symbol "_" it should be printed using SHIFT key (it is under the symbol "-").
Sometimes its typing is very annoying.

Thank you!