[SDL] How to gray out a button image?

James Lehman james at akrobiz.com
Tue Apr 15 23:02:25 PDT 2008


So you are saying that the digital output of this camera is cooked mpeg
video?

Ick!

That has nothing to do with good-old full-linear digital.

Are you sure?

If this is a gray scale camera, why would you care about RGB at all?

James.   :o)


----- Original Message ----- 
From: "Andreas Schiffler" <aschiffler at ferzkopp.net>
To: "A list for developers using the SDL library. (includes SDL-announce)"
<sdl at lists.libsdl.org>
Sent: Tuesday, April 15, 2008 11:27 PM
Subject: Re: [SDL] How to gray out a button image?


>
> You may want to use integer math ...
> http://en.wikipedia.org/wiki/YUV#Numerical_approximations
>
> The "brightness" value is the Y component. See also the blurb on MPEG
> compatibility (re: range of Y) and note that the input RGB values need
> to be uint32's to avoid overflows.
>
> Will Langford wrote:
> >>  grayed = (source_pixel_red * 0.10) + (source_pixel_green * 0.61) +
> >>  (source_pixel_blue * 0.19);
> >>
> >
> > Doh, mistyped math in the line,
> >
> > grayed = (source_pixel_red * 0.30) + (source_pixel_green * 0.59) +
> > (source_pixel_blue * 0.11);
> >
> > -Will
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> >
>
>


----------------------------------------------------------------------------
----


> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



More information about the SDL mailing list