hcg-minus-cairo-0.16: haskell cg (minus) (cairo rendering)

Safe HaskellNone
LanguageHaskell98

Render.CG.Minus

Contents

Description

CG (minus) rendering in terms of Render.

Synopsis

Paths

nil :: Render () Source #

Render nothing.

line2 :: Pt R -> Pt R -> Render () Source #

line :: Ls R -> Render () Source #

Render Ls as moveTo then sequence of lineTo.

polygon :: Ls R -> Render () Source #

Variant of line that runs closePath.

points :: R -> Ls R -> Render () Source #

Render Ls as set of square points with R dimension. Runs fill on each square.

circle :: Pt R -> R -> Render () Source #

Circle centred at Pt with radius R.

Context & drawing

grey :: R -> Render () Source #

Greyscale call to setSourceRGBA.

colour :: Ca -> Render () Source #

Ca call to setSourceRGBA.

pen :: R -> Ca -> ([R], R) -> Render () Source #

Set line width R and Ca.

Composite

area :: R -> Ca -> Ca -> Ls R -> Render () Source #

Run polygon on Ls then fill and stroke.

area_def :: Ca -> Ls R -> Render () Source #

Variant of area with default border of width 0.005 and grey 0.15.

outline :: R -> Ca -> Ls R -> Render () Source #

Run polygon on Ls then pen and stroke.

rect :: R -> Ca -> Pt R -> (R, R) -> Render () Source #

Outline rectangle given colour line width R, Ca, upper-left Pt and (width,height).

rect_fill :: Ca -> Pt R -> (R, R) -> Render () Source #

Solid variant of rect.

Text

text :: Ca -> Pt R -> R -> String -> Render () Source #

Render text String in colour Ca at Pt in font size sz.

Rendering

data File_Type Source #

Enumeration of file types.

Constructors

F_PDF 
F_SVG 

maybe_add_extension :: String -> FilePath -> FilePath Source #

If nm does not have ext append it.

map (maybe_add_extension ".pdf") ["x.pdf","x.y"] == ["x.pdf","x.y.pdf"]

render_to_file :: File_Type -> (R, R) -> FilePath -> Render () -> IO () Source #

Render to File_Type. (w,h) gives the page size. The appropriate extension is appended to FilePath if required.

render_to_pdf :: (R, R) -> FilePath -> Render () -> IO () Source #

Render to PDF file.

render_to_svg :: (R, R) -> FilePath -> Render () -> IO () Source #

Render to SVG file.