[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Patch for two grohtml bug fixes..

From: Ralph Corderoy
Subject: Re: [Groff] Patch for two grohtml bug fixes..
Date: Wed, 10 Oct 2001 22:55:33 +0100

Hi Werner,

> > So the code looks OK but the scale of `f' seems wrong since I'd
> > want `full on' for colour to be a simple `1f', not
> > `0.9999847412109375f'.
> > 
> > Shouldn't `f' scale by 65535?
> No.  1f=65536u.  Anything else would be extremely painful and
> non-intuitive IMHO.  The question should rather be: How shall we map
> the range [0.0,1.0] onto [0x0000,0xFFFF]?  My original code above
> handles 0xFFFF and 0x10000 equal, i.e, the color value `1.0' is
> handled as an exception for convenience.  What does e.g. Adobe do?

Adobe?  I only know PostScript which uses the range 0 -> 1, e.g. `0.5 1
0.1 setrgbcolor'.

> Scaling by 65535 might be an alternative, but I doubt it is worth the
> effort.  The `loss' by converting 1.0 to 0xFFFF instead of 0x10000 is
> really neglegible.

I agree, leave it as 1f=65536u.  And map as your original code with
0x10000 being allowed as an exception and treated as 0xffff.  Perhaps
also a one line comment pointing this out so it doesn't look like an
`out by one' error?  :-)  It's providing 16 bits of resolution and
since most things will only use the most significant eight of those
there shouldn't be a problem.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]