On Sat, 2 Dec 2000, Andreas Beck wrote:
> > I've attached a patch, which fixes at least the blue-part.
> > The fix results in:
> > rgba (FF00,FF00,FFFF,FFFF)
> > I don't know, why the red and green-part isn't correctly, too.
>
> Then you'd better have a look at your patch. It is quite incorrect.
> I didn't say that it is nontrivial without reason.
>
> > #define DOSHIFT(val, shift) \
> > - (((shift) >= 0) ? (val) << (shift) : (val) >> -(shift))
> > + (((shift) >= 0) ? (val) << (shift) | (val) : (val) >> -(shift))
>
> To correctly fix the problem, you also need to know the significant bits
> before and after the expansion.
>
> This is nothing you fix with a patch to doshift.
>
> To catch all cases you need a loop,
A loop over what? Over the rgb-compontents? Or over different colordepth?
> which is why I am worrying about performance.
What about unrolling the loop?
Christoph Egger
E-Mail: [EMAIL PROTECTED]