Bitmap-Save, Picture-Read

Peter Achten peter88@cs.kun.nl
Thu, 20 Apr 2000 10:24:31 -0700


Dear Valery,

At 11:12 20-4-00 +0400, you wrote:
>Hello clean-list,
>
>      I think that there is some distressing inclination with Bitmap
>      and Picture. Here I mean that:
>      
>      1. there is no code in last ObjectIO for saving Bitmap
Bitmap handling in Clean is still in its infancy. As you have noticed, we
have only added functionality to read in and draw entire bitmaps. We would
like to have more manipulative power such as writing bitmaps, and
operations such as rotation, mirroring, selections. However, this has no
high priority on our task list. 

>      2. there are lot of facilities for drawing into Picture and
>      there is no adequate way to "see" what is drawn. How can I read
>      from picture?
>      
>      Am I wrong?
The idea behind Pictures is that they are output-only objects. For
instance, if a program specifies that a line should be drawn from point A
to point B, then it is very platform dependent what the exact output will
be: will the line be anti-aliased? what pixels will be affected? will the
proper pen colour be used? For this reason we have decided that if the
application wants to know the content of a picture, it should administrate
it itself. 

>
>      Well I'd like to calculate some statistics for my bitmap image,
>      apply to that image some modification and then save it.
>      What is the best way here?
Because we have not implemented bitmap operations other than drawing them I
guess your best move is to make your own implementation of bitmaps (e.g. a
two-dimensional array of colours) and define your operations on them. 

Greetings,

Peter Achten