Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

veredz

Brightness & Contrast for Textures

This topic is 5834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, We want to display a gray scale texture. Each pixel=8bits. We must have a capability to change the contrast and brightness of the texture. The reason for this is that the user has a monitor with no adjustment. We succeeded doing it with loading a specified color palette and then loading the texture. For this we need the extension: GL_EXT_paletted_texture. Is there an alternative ? Thanks, Zvika Vered

Share this post


Link to post
Share on other sites
Advertisement
void glPixelTransferf(
GLenum pname,
GLfloat param
);

void glPixelTransferi(
GLenum pname,
GLint param
);

Pname Type Initial Value Valid Range
GL_MAP_COLOR Boolean false true/false
GL_MAP_STENCIL Boolean false true/false
GL_INDEX_SHIFT integer 0 ( – ,)
GL_INDEX_OFFSET integer 0 ( – ,)
GL_RED_SCALE float 1.0 ( – ,)
GL_GREEN_SCALE float 1.0 ( – ,)
GL_BLUE_SCALE float 1.0 ( – ,)
GL_ALPHA_SCALE float 1.0 ( – ,)
GL_DEPTH_SCALE float 1.0 ( – ,)
GL_RED_BIAS float 0.0 ( – ,)
GL_GREEN_BIAS float 0.0 ( – ,)
GL_BLUE_BIAS float 0.0 ( – ,)
GL_ALPHA_BIAS float 0.0 ( – ,)
GL_DEPTH_BIAS float 0.0 ( – ,)

If it was an RGB image I''d do GL_RED/GREEN/BLUE_SCALE and 1.5 to scale each RGB value by 1.5, but since your''s is 8bit I think you need to use INDEX_SHIFT and/or INDEX_OFFSET...

------------
- outRider -

Share this post


Link to post
Share on other sites
quote:
Original post by outRider
void glPixelTransferf(
GLenum pname,
GLfloat param
);

void glPixelTransferi(
GLenum pname,
GLint param
);

Pname Type Initial Value Valid Range
GL_MAP_COLOR Boolean false true/false
GL_MAP_STENCIL Boolean false true/false
GL_INDEX_SHIFT integer 0 ( – ,)
GL_INDEX_OFFSET integer 0 ( – ,)
GL_RED_SCALE float 1.0 ( – ,)
GL_GREEN_SCALE float 1.0 ( – ,)
GL_BLUE_SCALE float 1.0 ( – ,)
GL_ALPHA_SCALE float 1.0 ( – ,)
GL_DEPTH_SCALE float 1.0 ( – ,)
GL_RED_BIAS float 0.0 ( – ,)
GL_GREEN_BIAS float 0.0 ( – ,)
GL_BLUE_BIAS float 0.0 ( – ,)
GL_ALPHA_BIAS float 0.0 ( – ,)
GL_DEPTH_BIAS float 0.0 ( – ,)

If it was an RGB image I''d do GL_RED/GREEN/BLUE_SCALE and 1.5 to scale each RGB value by 1.5, but since your''s is 8bit I think you need to use INDEX_SHIFT and/or INDEX_OFFSET...

------------
- outRider -


I would like to thank you for your help. It works !!!

Best regards,
Zvika Vered.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!