On Wed, Mar 09, 2005 at 05:39:57PM +0100, Denis Oliver Kropp wrote:
> Quoting Ville Syrj�l�:
> > > A generic version would check if the MSB of each RGB channel matches,
> > > but I don't think there's an acceptable implementation for this.
> > 
> > Something like this?
> > 
> > if (DFB_BYTES_PER_PIXEL(format) == 1 ||
> >     (dfb_color_to_pixel(config->format, 0x80,0x80,0x80) ^
> >      dfb_color_to_pixel(format, 0x80,0x80,0x80)) == 0)
> >    format = config->format;
> > 
> > Are there problems with this implementation?
> 
> I thought about dfb_color_to_pixel(), but too short to see that two
> calls would be enough. Anyways, comparing both results should be
> the same.

I don't know what I was thinking when I wrote the above test becasue 
a^b==0 is the same as a==b :) But it should still work.

> Ok, no extra function ;)

Ok. So I'll add DSPF_RGB15 and change that format test.

-- 
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to