-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday 22 February 2003 02:55, John Hall wrote:
> Many years ago I had a similar requirement. I built another ("colour") map
> with identical dimensions. It was not displayed, but had areas that matched
> those on the real map. These areas were coloured according to the function
> desired for that position on the real map.
i'm guessing this is for an embedded device given the technology choices and
other info on Nathanael's site. if so, it should be noted that this is a
resource expensive approach. allowing up to 16 callbacks per screen at
640x480 would take probably 150k of RAM[1] if using a bitmap, not counting
disk space for storing same or the (trivial) memory requirements for the
actual mapping. obviously none of this matters if you have storage to spare.
probably more important for an embedded system is that such a large amount of
data will result in large numbers of cache misses. most embedded chips have,
AFAIK, horribly small amounts of on-chip cache.
if you do care or want greater flexibility (e.g. overlapping regions, fast
movement of regions, larger numbers of regions, etc) polygon inclusion is
probably a better bet. in 150k of RAM you could store 19,200 rectangular
regions[2], or you could store 16 rectangular regions in 128 bytes of RAM.
more complex polygons would required more memory, of course, but the amounts
would remain trivial. the algorithms are computationally inexpensive, too.
[1] you probably wouldn't go for 8 callbacks (or 3 bits/pixel) since that
would leave you with values overlapping word boundaries, so no matter what
primitives you used you'd end up with odd bit shifting routines and poor
performance. so you'd probably go with 2 pixels / byte giving 150k usage.
one byte per pixel would allow for 256 callbacks but also 300k memory usage,
of course.
- --
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE: The 'K' is for 'kick ass'
http://www.kde.org http://promo.kde.org/3.1/feature_guide.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+V11B1rcusafx20MRAn5wAKCHtzL54i5Btk/7oxhNyDoPIVfSrwCfQ98Z
VJevuqZzEoBVI1BXPNZAifE=
=EzRO
-----END PGP SIGNATURE-----