-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell Postscript -- -- Haskell library partially implementing the postscript drawing model. @package hps @version 0.11 -- | Matrix type and functions. module Graphics.PS.Matrix -- | Synonym for Double. type R = Double -- | Transformation matrix data type. data Matrix Matrix :: R -> R -> R -> R -> R -> R -> Matrix -- | The identity matrix. identity :: Matrix -- | A translation matrix with independent x and y offsets. translation :: R -> R -> Matrix -- | A scaling matrix with independent x and y scalars. scaling :: R -> R -> Matrix -- | A rotation matrix through the indicated angle (in radians). rotation :: R -> Matrix instance Eq Matrix instance Show Matrix instance Num Matrix -- | Unit definitions and conversions. module Graphics.PS.Unit -- | Convert degrees to radians. radians :: Floating a => a -> a -- | Convert millimeters to PS points. mm_pt :: Floating a => a -> a -- | Paper sizes. For ISO sizes see -- http://www.cl.cam.ac.uk/~mgk25/iso-paper.html. module Graphics.PS.Paper -- | Paper size data type. data Paper Paper :: Int -> Int -> Paper width :: Paper -> Int height :: Paper -> Int -- | BoundingBox for an EPSF file with an optional HiResBoundingBox data BBox BBox :: Int -> Int -> Int -> Int -> BBox -- | lower left x (x-min) llx :: BBox -> Int -- | lower left y (y-min) lly :: BBox -> Int -- | upper right x (x-max) urx :: BBox -> Int -- | upper right y (y-max) ury :: BBox -> Int HRBBox :: Int -> Int -> Int -> Int -> Double -> Double -> Double -> Double -> BBox -- | lower left x (x-min) llx :: BBox -> Int -- | lower left y (y-min) lly :: BBox -> Int -- | upper right x (x-max) urx :: BBox -> Int -- | upper right y (y-max) ury :: BBox -> Int -- | high resolution llx hrllx :: BBox -> Double -- | high resolution lly hrlly :: BBox -> Double -- | high resolution urx hrurx :: BBox -> Double -- | high resolution ury hrury :: BBox -> Double -- | Swap width and height of Paper. landscape :: Paper -> Paper -- | A div variant that rounds rather than truncates. -- --
--   let f (Paper _ h) = h `div` 2 == h `divRound` 2
--   in all id (map f [b0,b1,b2,b3,b4,b5,b6,b7,b8,b9]) == False
--   
divRound :: Int -> Int -> Int -- | ISO size downscaling, ie. from A0 to A1. -- --
--   iso_down_scale a4 == a5
--   
iso_down_scale :: Paper -> Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a0, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b0, b10, b9, b8, b7, b6, b5, b4, b3, b2, b1 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c0, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1 :: Paper -- | US Letter size in millimeters (ie Paper 216 279). usLetter :: Paper -- | Newspaper sizes in millimeters. See -- http://www.papersizes.org/newspaper-sizes.htm. broadsheet, tabloid, berliner :: Paper -- | Proportion of Paper. -- --
--   proportion broadsheet == 1.25
--   map (round . (* 1e3) . proportion) [a0,b0,c0] == [1414,1414,1414]
--   map proportion [usLetter,berliner,tabloid]
--   
proportion :: Paper -> Double instance Eq Paper instance Show Paper instance Eq BBox instance Show BBox -- | PS graphics state. module Graphics.PS.GS -- | Graphics state. data GS GS :: Color -> LineWidth -> LineCap -> LineJoin -> ([Int], Int) -> Double -> GS -- | Line cap enumeration. data LineCap ButtCap :: LineCap RoundCap :: LineCap ProjectingSquareCap :: LineCap -- | Line join enumeration. data LineJoin MiterJoin :: LineJoin RoundJoin :: LineJoin BevelJoin :: LineJoin -- | Line width (real). type LineWidth = Double -- | Colour model. data Color RGB :: Double -> Double -> Double -> Color -- | Default GS of indicated Color. defaultGS :: Color -> GS -- | Default GS of indicated shade of grey. greyGS :: Double -> GS instance Eq LineCap instance Show LineCap instance Enum LineCap instance Eq LineJoin instance Show LineJoin instance Enum LineJoin instance Eq Color instance Show Color instance Eq GS instance Show GS -- | Font type and functions. module Graphics.PS.Font -- | Font data type. data Font Font :: String -> Double -> Font fontName :: Font -> String fontSize :: Font -> Double instance Eq Font instance Show Font -- | Glyph data type. module Graphics.PS.Glyph -- | Character data type. type Glyph = Char -- | Point type and associated functions. module Graphics.PS.Pt -- | Cartesian co-ordinate with real valued x and y fields. data Pt Pt :: Double -> Double -> Pt -- | Convert from polar to rectangular co-ordinates. polarToRectangular :: Pt -> Pt -- | Pt at x and y minima of inputs. ptMin :: Pt -> Pt -> Pt -- | Pt at x and y maxima of inputs. ptMax :: Pt -> Pt -> Pt -- | x and y elements of a set of Pts. ptXYs :: [Pt] -> [Double] -- | Origin, ie. (Pt 0 0). origin :: Pt -- | Apply a transformation matrix to a point. ptTransform :: Matrix -> Pt -> Pt instance Eq Pt instance Show Pt instance Ord Pt instance Num Pt -- | Bezier functions. module Graphics.PS.Bezier -- | Four-point bezier curve interpolation. The index mu is in the -- range zero to one. bezier4 :: Pt -> Pt -> Pt -> Pt -> Double -> Pt -- | Path type and functions. module Graphics.PS.Path -- | Path data type,in cartesian space. data Path MoveTo :: Pt -> Path LineTo :: Pt -> Path CurveTo :: Pt -> Pt -> Pt -> Path ClosePath :: Pt -> Path Text :: Font -> [Glyph] -> Path PTransform :: Matrix -> Path -> Path Join :: Path -> Path -> Path -- | Infix notation for Join. (+++) :: Path -> Path -> Path -- | Line segments though list of Pt. line :: [Pt] -> Path -- | Variant of line connecting the last Pt to the first. polygon :: [Pt] -> Path -- | Rectangle with lower left at Pt and of specified width and -- height. Polygon is oredered anticlockwise from lower left. rectangle :: Pt -> Double -> Double -> Path -- | Arc given by a central point,a radius,and start and end angles. arc :: Pt -> Double -> Double -> Double -> Path -- | Negative arc. arcNegative :: Pt -> Double -> Double -> Double -> Path -- | Annular segment. annular :: Pt -> Double -> Double -> Double -> Double -> Path -- | Apply any transformations at path. The resulting path will not have -- any PTransform nodes. flatten :: Path -> Path -- | Render each (p1,p2) as a distinct line. renderLines :: [(Pt, Pt)] -> Path -- | Collapse line sequences into a single line. renderLines' :: [(Pt, Pt)] -> Path instance Eq Path instance Show Path -- | Image type and functions. module Graphics.PS.Image -- | An image is a rendering of a graph of Paths. data Image Stroke :: GS -> Path -> Image Fill :: GS -> Path -> Image ITransform :: Matrix -> Image -> Image Over :: Image -> Image -> Image Empty :: Image -- | Layer one Image over another. over :: Image -> Image -> Image instance Eq Image instance Show Image -- | Path statistics. module Graphics.PS.Statistics -- | Path statistics data type. data Statistics Statistics :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Statistics nMoveTo :: Statistics -> Integer nLineTo :: Statistics -> Integer nCurveTo :: Statistics -> Integer nClosePath :: Statistics -> Integer nGlyph :: Statistics -> Integer nTransform :: Statistics -> Integer -- | Determine number of path components of each type. pathStatistics :: Path -> Statistics -- | Class and associated functions for Matrix transformations. module Graphics.PS.Transform -- | Values that can be transformed in relation to a Matrix. class Transformable a -- | Translation in x and y. translate :: Transformable a => Double -> Double -> a -> a -- | Scaling in x and y. scale :: Transformable a => Double -> Double -> a -> a -- | Rotation, in radians. rotate :: Transformable a => Double -> a -> a instance Transformable Pt instance Transformable Path instance Transformable Image -- | Path query functions and related operations. module Graphics.PS.Query -- | Locate the starting point of the path, which must begin with a -- MoveTo node. startPt :: Path -> Maybe Pt -- | Locate the end point of the path. endPt :: Path -> Maybe Pt -- | Ensure path begins with a MoveTo node. mkValid :: Path -> Path -- | Approximate curves as n straight line segments. That is replace -- CurveTo nodes with n LineTo nodes calculated -- using bezier4. approx :: Double -> Path -> Path -- | Append a LineTo the start point of Path. close :: Path -> Path -- | Postscript generator. module Graphics.PS.PS -- | Write a postscript file. The list of images are written one per page. ps :: FilePath -> Paper -> [Image] -> IO () -- | Write an encapsulated postscript file. The single image is written. eps :: String -> BBox -> Image -> IO () -- | Generate postscript data given title, page size, and a set of -- page I.Images. stringFromPS :: String -> Paper -> [Image] -> String instance Monad m => Monoid (MonadMonoid m) -- | Set of predefined Paths. module Graphics.PS.Path.Graphs -- | See -- ftp.scsh.net/pub/scsh/contrib/fps/doc/examples/fractal-sqr.html fractal_sqr_pt :: Pt -> Pt -> Int -> [(Pt, Pt)] -- | Path of fractal_sqr_pt with inputs (250,250), -- (175,175), 12. fractal_sqr :: Path -- | renderLines' variant of fractal_sqr. fractal_sqr' :: Path -- | A unit arrow. unitArrow :: Int -> Path -- | See -- ftp.scsh.net/pub/scsh/contrib/fps/doc/examples/fractal-arrow.html fractalArrow :: Double -> Int -> Path -- | Isosceles right angled triangle erat :: Pt -> Double -> Path -- | Sierpinski triangle. sierpinski :: Pt -> Double -> Double -> Path -- | Top-level module for hps. module Graphics.PS