Graphics hierarchy

Ketil Z. Malde ketil@ii.uib.no
27 Feb 2002 10:07:06 +0100


Ashley Yakeley <ashley@semantic.org> writes:

> At 2002-02-27 00:44, Sven Panne wrote:
> 
>>   * It's unclear what Graphics.Format is supposed to do exactly.
>>     Could somebody explain this?

> Perhaps functions of the form 

> encodePNG :: Image -> [Word8]
> decodePNG :: [Word8] -> Maybe Image

Or, somewhat more generally:

-- probably elsewhere in the hierarchy
class FileFormat a where
        encode :: a -> [Word8]
        decode :: [Word8] -> a


instance FileFormat PNG where
        encode = ...
        decode = ..

And perhaps:

class Image a where
        rotate :: a -> Int -> a
        scale :: a -> Int -> Int -> a
        
Maybe compose/blend images?  Altering alpha and gamma, color
manipulation?

I guess it would be a good idea to look at some particular application
implementations, and derive a useful library from that.  Let's not
invent another library that nobody knows how to use properly.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants