JuicyPixels-canvas-0.1.0.0: Functions for drawing lines, squares and so on pixel by pixel

Safe HaskellNone

Codec.Picture.Canvas

Description

Functions for drawing lines, squares and so on pixel by pixel

Synopsis

Documentation

data Canvas a Source

Canvas ADT

Instances

Eq a => Eq (Canvas a) 
Show (Canvas a) 

canvasWidth :: Canvas a -> IntSource

Canvas width

canvasHeight :: Canvas a -> IntSource

Canvas height

imageToCanvas :: Pixel a => Image a -> Either String (Canvas a)Source

Convert Image to Canvas

canvasToImage :: Pixel a => Canvas a -> Image aSource

Convert Canvas to Image

getColor :: Pixel a => Int -> Int -> Canvas a -> aSource

Get color of specified pixel

setColor :: Pixel a => Int -> Int -> a -> Canvas a -> Canvas aSource

Set color of specified pixel

drawLine :: Pixel a => Int -> Int -> Int -> Int -> a -> Canvas a -> Canvas aSource

Draw a line with specified color

drawPolygon :: Pixel a => [(Int, Int)] -> a -> Canvas a -> Canvas aSource

Draw a polygon with specified color

drawRectangle :: Pixel a => Int -> Int -> Int -> Int -> a -> Canvas a -> Canvas aSource

Draw a rectangle with specified color

drawSquare :: Pixel a => Int -> Int -> Int -> a -> Canvas a -> Canvas aSource

Draw a square with specified color