From: tmoran@acm.org
Subject: Re: Q re pack & aliased
Date: Wed, 23 Apr 2003 17:18:15 GMT
Date: 2003-04-23T17:18:15+00:00 [thread overview]
Message-ID: <rVzpa.346022$Zo.75904@sccrnsc03> (raw)
In-Reply-To: b85hls$6i604$1@ID-175126.news.dfncis.de
| x : bunches (1 .. 10);
| for x'Size use 240;
Unfortunately, one rarely knows the width of an image file at
compile time. What does your program print with and without
the "for x'Size use 240;"?
>a conversion between a 24-bit-type like you used before and the
>triples-record is quite easy without breaking too much...
I'm sorry if that wasn't clear. My "24-bit-type" is indeed
a record, just like your example. The sole difference is the
addition of a specific layout for the color components:
for Triple_Color_Type use record
Blue at 0 range 0 .. 7;
Green at 1 range 0 .. 7;
Red at 2 range 0 .. 7;
end record;
Dropping the word "aliased" and changing to:
-- type Triple_Color_Ptr_Type is access all Triple_Color_Type;
package Gnat315_Workaround
is new System.Address_To_Access_Conversions(Object=>Triple_Color_Type);
subtype Triple_Color_Ptr_Type is Gnat315_Workaround.Object_Pointer;
...
Image_Ptr : Triple_Color_Ptr_Type
-- := x(i)'Unchecked_Access;
:= Gnat315_Workaround.To_Pointer
(x(i)'address);
makes the program work under Gnat, at the expense of ugliness, additional
special case documentation, and obscuring the fact that pixels are aliased.
next prev parent reply other threads:[~2003-04-23 17:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-20 1:08 Q re pack & aliased tmoran
2003-04-20 11:40 ` David Holm
2003-04-21 4:44 ` tmoran
2003-04-22 16:08 ` Jacob Sparre Andersen
2003-04-22 16:30 ` Vinzent Hoefler
2003-04-22 16:44 ` tmoran
2003-04-22 17:23 ` Stephen Leake
2003-04-22 21:45 ` Robert A Duff
2003-04-22 22:25 ` tmoran
2003-04-22 23:10 ` Nick Roberts
2003-04-23 0:24 ` tmoran
2003-04-23 8:07 ` Vinzent Hoefler
2003-04-23 17:18 ` tmoran [this message]
2003-04-23 19:28 ` Vinzent Hoefler
2003-04-23 11:52 ` Martin Dowie
2003-04-25 16:06 ` Nick Roberts
2003-04-25 16:38 ` Vinzent Hoefler
2003-04-22 22:51 ` Matthew Heaney
2003-04-22 23:16 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox