Graphics hierarchy
Keith Wansbrough
Keith.Wansbrough@cl.cam.ac.uk
Wed, 27 Feb 2002 10:26:13 +0000
Ashley says:
> Ketil says:
>
> >class Image a where
> > rotate :: a -> Int -> a
> > scale :: a -> Int -> Int -> a
> >
> >Maybe compose/blend images? Altering alpha and gamma, color
> >manipulation?
>
> Sounds like a serious project, with the possibility of plenty of
> complication.
I agree with Ashley - surely we're not trying to write *new*
libraries, we're just trying to better organise the existing ones.
The two options that spring to mind are
1. not having a shared Image type or class at all (just types PNG,
GIF, JPEG, etc)
and/or
2. having a basic type RawImage which is just an array of pixels
(maybe you need RawBitImage, RawGreyImage, RawIndexImage, RawRGBImage)
which all the various formats can convert to and from, adding their
various extra information (resolution, copyright, palette, etc).
Then someone can write general rotation / scale / compositing etc
routines if they feel like it (maybe stealing ideas/code from the pnm*
utilities?).
--KW 8-)