juicy-draw-0.2.0.0: Draw and fill lines, rectangles and polygons

Copyright(C) Richard Cook 2018
LicenseMIT
Maintainerrcook@rcook.org
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Codec.Picture.Drawing

Description

Functions for drawing and filling lines, rectangles and polygons directly onto a JuicyPixels mutable image

Synopsis

Documentation

drawLine Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> Int

x-coordinate of starting point

-> Int

y-coordinate of starting point

-> Int

x-coordinate of end point

-> Int

y-coordinate of end point

-> px

colour

-> m ()

action

Draw a line in the specified colour

drawPolygon Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> [Point2D]

sequence of vertices

-> px

colour

-> m ()

action

Draw a polygon in the specified colour

drawRectangle Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> Int

x-coordinate of top-left corner

-> Int

y-coordinate of top-left corner

-> Int

x-coordinate of bottom-right corner

-> Int

y-coordinate of bottom-right corner

-> px

colour

-> m ()

action

Draw a rectangle in the specified colour

fillPolygon Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> [Point2D]

sequence of vertices

-> px

colour

-> m ()

action

Fill a polygon as a series of triangles with the specified colour

fillRectangle Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> Int

x-coordinate of top-left corner

-> Int

y-coordinate of top-left corner

-> Int

x-coordinate of bottom-right corner

-> Int

y-coordinate of bottom-right corner

-> px

colour

-> m ()

action

Fill a rectangle with the specified colour

fillTriangle Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> MutableImage (PrimState m) px

mutable image

-> Int

x-coordinate of first vertex

-> Int

y-coordinate of first vertex

-> Int

x-coordinate of second vertex

-> Int

y-coordinate of second vertex

-> Int

x-coordinate of third vertex

-> Int

y-coordinate of third vertex

-> px

colour

-> m ()

action

Fill a triangle with the specified colour

withDefaultMutableImage Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> Int

image width

-> Int

image height

-> (MutableImage (PrimState m) px -> m ())

function to apply to mutable image

-> m (Image px)

immutable image result

Create an image given a function to apply to a default empty mutable image

withMutableImage Source #

Arguments

:: (Pixel px, PrimMonad m) 
=> Int

image width

-> Int

image height

-> px

background colour

-> (MutableImage (PrimState m) px -> m ())

function to apply to mutable image

-> m (Image px)

action

Create an image given a function to apply to an empty mutable image