PATCH: Fix XV overlay color attr. (Intel-2.2.1)

Edgar Toernig froese at gmx.de
Sat May 10 03:29:22 PDT 2008


Thomas Fritzsche wrote:
>
> +    if (pPriv->contrast <= 128) contrast = (int) (pPriv->contrast / 2);
> +    else contrast = (int) (64  + (pPriv->contrast -127) * (192/127));
> +    if (contrast > 255) contrast = 255;

> +    if (pPriv->saturation <= 512) saturation = (int) (pPriv->saturation / 4 );
> +    else saturation = (int) (128  + (pPriv->saturation-512) * (895/512));	
> +    if ( saturation > 1023 ) saturation = 1023;

Expressions like (192/127) are evalutated to 1.  Is that really what
you want?  The constants itself look a little bit off, too.

What about:

       else contrast = 64 + (pPriv->contrast - 128) * 191 / 127;

       else saturation = 128 + (pPriv->saturation - 512) * 895 / 511;	

instead?

Ciao, ET.




More information about the xorg mailing list