Fw: [AD] Color convertors

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> ----- Original Message -----
> From: "Bob" <ohannessian@xxxxxxxxxx>
>
> > In any case, I was re-writting the 16->32 convertor, and as Angello
found
> > out, white (0xFFFF) was converted to a nice shade of gray (0xF8FCF8). So
> my
> > question is: should I add 0x070307 to the converted color, or leave
things
> > as is? What about 0x030103?
> >
> > Something similar will be done for the 15->32 too.
>
>
> assuming c is right aligned unsigned
> 6bits to 8bit is:
>
> c = (c<<2) | (c>>4)
>
> 5bits to 8bit is:
>
> c = (c<<3) | (c>>2)
>
> these properly scale the value
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/