comp.lang.ada
 help / color / mirror / Atom feed
From: patkwee@web.de (Pat)
Subject: Re: Color components and fixed point numbers
Date: 4 Mar 2004 05:31:54 -0800
Date: 2004-03-04T05:31:54-08:00	[thread overview]
Message-ID: <fc19748c.0403040531.7d7bdc9d@posting.google.com> (raw)
In-Reply-To: tP71c.29732$PR3.512648@attbi_s03

tmoran@acm.org wrote 

> Declaring
>   type Small_Comp is delta 1.0 / 255 range 0.0 .. 1.0;
>   for Small_Comp'small use 1.0/255;
>   for Small_Comp'Size use 8;
> 
>   type Wide_Comp is delta 1.0 / 65535 range 0.0 .. 1.0;
>   for Wide_Comp'small use 1.0/65535;
>   for Wide_Comp'Size use 16;
> 
> pads with greater than zero.
> 
> Note that 0.5 is then not exactly representable since 0.5*255= 127.5 I
> have one compiler that truncates to 7F and another that rounds to 80.  

Isn't it specified how the compiler has to round, if he has to convert
a
floating point constant into a fixed point value?


> IMO, black is black, ie 00 = 0000, but "brightest" is not really fixed.
> Is the brightness of the screen using 8 bit color and Small_Comp'last the
> same as, or slightly less than, the brightness using Wide_Comp'last?  And
> what happens if you turn up the monitor's brightness control?  "1.0" is a
> very artifical value.

I don't really care how at last a montior or whatever converts my
color to light. I care more about the abstract value of a brightest
color in color model I am using while doing calculation with the
color. So often I want to convert a 8-bit color component to a 16-bit
one to have more precision while doing calculations on it and
afterwards I will convert it back into a 8-bit one.

Anyway, thank you very much for your answers, best regards, Pat



      reply	other threads:[~2004-03-04 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01 11:49 Color components and fixed point numbers Pat
2004-03-01 16:24 ` Robert I. Eachus
2004-03-02 10:58   ` Pat
2004-03-02 16:39     ` Robert I. Eachus
2004-03-02 22:23     ` tmoran
2004-03-04 13:31       ` Pat [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox