From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac625b61af767c90 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-04 05:31:54 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: patkwee@web.de (Pat) Newsgroups: comp.lang.ada Subject: Re: Color components and fixed point numbers Date: 4 Mar 2004 05:31:54 -0800 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 149.157.1.122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1078407114 14928 127.0.0.1 (4 Mar 2004 13:31:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 4 Mar 2004 13:31:54 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6054 Date: 2004-03-04T05:31:54-08:00 List-Id: 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