BASIC

Author Topic: Hue/Saturation of a picture  (Read 3216 times)

Offline acristo

  • Mr. Drawsprite
  • **
  • Posts: 51
    • View Profile
Hue/Saturation of a picture
« 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

Sebastian

  • Guest
Re: Hue/Saturation of a picture
« Reply #1 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

Offline tictac

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
    • newLisp Italian blog!
Re: Hue/Saturation of a picture
« Reply #2 on: 2008-Jul-09 »
Can I apply shaders in a 2D game? (I'm sorry for the question, but I'm a GLBasic beginner!)
-Alessandro

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hue/Saturation of a picture
« Reply #3 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?

Offline tictac

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
    • newLisp Italian blog!
Re: Hue/Saturation of a picture
« Reply #4 on: 2008-Jul-09 »
Sounds good!

Thank you!
-Alessandro

Offline acristo

  • Mr. Drawsprite
  • **
  • Posts: 51
    • View Profile
Re: Hue/Saturation of a picture
« Reply #5 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 :)

Offline tictac

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
    • newLisp Italian blog!
Re: Hue/Saturation of a picture
« Reply #6 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!
-Alessandro

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Hue/Saturation of a picture
« Reply #7 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.

Offline tictac

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
    • newLisp Italian blog!
Re: Hue/Saturation of a picture
« Reply #8 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!
-Alessandro