From: patkwee@web.de (Pat)
Subject: Color components and fixed point numbers
Date: 1 Mar 2004 03:49:23 -0800
Date: 2004-03-01T03:49:23-08:00 [thread overview]
Message-ID: <fc19748c.0403010349.123e946a@posting.google.com> (raw)
Hi,
I would like to declare two records representing a RGB Color with two
different percisions. The Small one with color components from 0..255
and the Wide one with components from 0..65535. Could I use fixed
point numbers to hide the different precision: e.g.
type Small_Component is delta 1/255 range 0.0 .. 1.0
type Wide_Component is delta 1/65535 range 0.0 .. 1.0
type Small_RGB is record
r,g,b:Small_Component
end record
type Wide_RGB is record
r,g,b:Wide_Component
end record
Then later I could use something like this to convert between the
different precisions:
w : Wide_RGB
s : Small_RGB
w.r = Wide_Component(s.r);
I tried to implement this but suprisingly Wide_Component(
Small_Component(1.0)) < 1.0 ? Does somebody know a workaround?
Thanks, Pat
next reply other threads:[~2004-03-01 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-01 11:49 Pat [this message]
2004-03-01 16:24 ` Color components and fixed point numbers 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox