comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Representing image data
Date: Wed, 11 Mar 2009 22:39:34 +0000 (UTC)
Date: 2009-03-11T22:39:34+00:00	[thread overview]
Message-ID: <gp9ej6$sov$1@aioe.org> (raw)
In-Reply-To: dPVtl.2650$%u5.1401@nwrddc01.gnilink.net

CLAW (which is for Windows) uses children of a root tagged type for
the different pixel representations. Thus
    type VGA_DIBitmap_Type (Height, Width : Claw.Int) is
        new Basic_DIBitmap_Type (Height, Width) with record ...
and
    type RGB555_DIBitmap_Type (Height, Width : Claw.Int) is
        new Basic_DIBitmap_Type (Height, Width) with record ...
with appropriate procedures for Windows system calls.

Writing takes a classwide parameter so it can write any format,
and Read is a function returning a classwide type.

If the application is always dealing with one kind - 24 bit RGB, say,
then it can be written to efficiently deal with only that.  If it
must handle several kinds it can use the same mechanism to make
a routine that efficiently does something with 24 bit RGB bitmaps,
another routine if it's a 555 RGB bitmap, etc and let dispatching
call the right one.  So what code to use for different kinds of pixels
is decided at the bitmap level, not again and again for each pixel.



  reply	other threads:[~2009-03-11 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 21:26 Representing image data Kenneth Almquist
2009-03-11  1:16 ` Gautier
2009-03-11  2:43   ` Srini -
2009-03-11 21:12   ` Kenneth Almquist
2009-03-11 22:39     ` tmoran [this message]
2009-03-12  2:38   ` Randy Brukardt
2009-03-11  9:00 ` Dmitry A. Kazakov
2009-03-11 15:45   ` Brian Drummond
2009-03-11 20:12     ` sjw
2009-03-13 11:31       ` Brian Drummond
2009-03-13 20:31 ` Kenneth Almquist
replies disabled

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