Betr.: [clean-list] Bitmaps

M.Kesseler@aia.nl M.Kesseler@aia.nl
Tue, 11 Sep 2001 12:03:02 +0200


Erik Zuurbier wrote:
>With hindsight I understand that even if Clean were able to
>generate a true bitmap to be printed, I could not expect the
>Clean compiler to make the correct optimization decisions automatically:
>generate print-instructions for characters, lines, circles, dots, or
>compile the result in a bitmap and (store and) print that.

I am not very familiar with the Object IO libs, but this should hardly be a
question of optimisation. If one considers that a screen isn't (or
shouldn't be)
a bitmap, but can contain bitmaps, lines, characacters etc. the only thing
that needs
to happen is to send bitmaps to the printer as bitmaps, lines as lines, and
character as characters.

>So it would be nice to be able to generate printable bitmaps, and it would
>be even nicer if I had some smart way to control the optimization I just
>described.
>
>Another thing: someone once asked for the possibility to access individual
>pixels in a bitmap. I back that. The only way currently to do that is to
>save a mirror of the bitmap in the program state. Seems like a waste to
me.

I am not sure what the application of this feature would be. It may be
useful
to process a bitmap, but I am not sure whether it should be done via a
function that
retrieves individual pixels.

>Third: If you really want to program independent of the screen/printer
>resolution, it should be possible to access a bitmap not in pixels but
>in points (one point is one inch / 72 if I remember correctly). I don't
>know if this is feasible.

One way of dealing with this is to store a transformation matrix along with
the
bitmap. This matrix maps pixels onto some coordinate system (or vice versa)
that
has some real-world units (cm, point, inch, whatever). This allows for
rotated,
skewed, translated, etc. bitmaps. It is usually easiest to perform pixel
operations on the pixel level, not in terms of the higher level coordinate
system.
In the higher level coordinate system, bitmaps can be dealt with (as a
whole)
in the same way as characters, lines etc. They can be scaled, moved, etc.
by
computing a new matrix.

The nice thing about this is that printers support this view of bitmaps
directly:
One can just send the bitmap and the transformation matrix to the printer
(at least
PostScript you can). The printer will do the rest (including nice/optimised
rendering of transformed bitmaps).

>   ...
>   * Camera, focal or orthogonal projection. Where, how oriented.
>   * Reconstruction of polygons/patches from numerical data
>   * Hidden entity removal. Z-buffer, or silly Painter, or what not...
>   * Colour and lighting procedures, Gouraud/Phong interpolation, etc...
>
>   Again, I could continue... But it has nothing to do with the main
religious
>   issues on this mailing list, I assure you only that Clean is a VERY
GOOD
>   language to program such stuff.

regards,
Marco Kesseler

----------------------------------------------------------------------
Aia                                     Phone: +31 24 371 02 30
PO Box 38025                   Fax:   +31 24 371 02 31
6503 AA Nijmegen             Email: M.Kesseler@aia.nl
The Netherlands                URL:  http://www.aia.nl
----------------------------------------------------------------------
This E-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are adressed. If you have received this E-mail in error please notify
the postmaster (postmaster@aia.nl). The authenticity of this message
cannot, at this moment, be guaranteed by ourselves. For this reason no
legal rights may be granted should the contents differ to the original
sent message. The Aia log-file of sent messages is deemed to be the
sole, true transcript of communication unless the contrary, other
than the received message, can be proven.
----------------------------------------------------------------------