[SDL] help with displaying grayscale buffers

another james james at akrobiz.com
Mon Apr 14 17:54:50 PDT 2008


Well, you could try to put just the top 8 bits of that 16 bit number into a
color statement like this:

SDL_MapRGB(screen->format, value >> 8, value >> 8, value >> 8);

James.   :o)




grapesmoker wrote:
> 
> Hi James,
> 
> You are correct, I only have one 16-bit value that represents the light
> intensity. I should have made that clearer.
> 
> I am using Windows XP and the video card I have supports that resolution.
> The weirdest thing is that I once got this code to work, but then I
> changed something (I don't remember what) and I no longer am able to view
> the image the way I want (which would be as a smooth grayscale). I would
> settle for an 8-bit grayscale too, since the display itself is not for
> precision measurements (those are done on the saved images).
> 
> Is the image I uploaded visible? I could upload another if it's not.
> Thanks for your attempt to help.
> 
> Jerry
> 
> 
> 
> another james wrote:
>> 
>> Wait a minute!
>> 
>> You probably have only (1) 16-bit value to look at simply as a light
>> intensity.
>> 
>> Do you have a video card that can show you 16 bits of resolution of pure
>> intensity?
>> I think you'd need a card that can do 16 bits on each of the RGB DACs.
>> 
>> If SDL is structured all the way through to look at RGB color values as 8
>> bit values, then you're kinda' screwed.
>> 
>> What OS are you dealing with?
>> 
>> James.   :o)
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/help-with-displaying-grayscale-buffers-tp16599288p16692970.html
Sent from the SDL mailing list archive at Nabble.com.



More information about the SDL mailing list