-- 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.14 -- | 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 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a10 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a9 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a8 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a7 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a6 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a5 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a4 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a3 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a2 :: Paper -- | ISO A sizes in millimeters. -- --
--   a4 == Paper 210 297
--   
a1 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b0 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b10 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b9 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b8 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b7 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b6 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b5 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b4 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b3 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b2 :: Paper -- | ISO B sizes in millimeters. -- --
--   b4 == Paper 250 354
--   
b1 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c0 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c10 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c9 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c8 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c7 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c6 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c5 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c4 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c3 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
c2 :: Paper -- | ISO C sizes in millimeters. -- --
--   c4 == Paper 229 324
--   
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 :: Paper -- | Newspaper sizes in millimeters. See -- http://www.papersizes.org/newspaper-sizes.htm. tabloid :: Paper -- | Newspaper sizes in millimeters. See -- http://www.papersizes.org/newspaper-sizes.htm. 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 -- | Path type and functions. module Graphics.PS.Path -- | Path data type,in cartesian space. data Path MoveTo :: (Pt Double) -> Path LineTo :: (Pt Double) -> Path CurveTo :: (Pt Double) -> (Pt Double) -> (Pt Double) -> Path ClosePath :: (Pt Double) -> Path Text :: Font -> [Glyph] -> Path PTransform :: (Matrix Double) -> Path -> Path Join :: Path -> Path -> Path -- | Infix notation for Join. (+++) :: Path -> Path -> Path -- | Line segments though list of Pt. line :: [Pt Double] -> Path -- | Variant of line connecting the last Pt to the first. polygon :: [Pt Double] -> Path -- | Rectangle with lower left at Pt and of specified width and -- height. Polygon is ordered anticlockwise from lower left. rectangle :: Pt Double -> Double -> Double -> Path -- | Arc given by a central point,a radius,and start and end angles. arc :: Pt Double -> Double -> Double -> Double -> Path -- | Negative arc. arcNegative :: Pt Double -> Double -> Double -> Double -> Path -- | Annular segment. annular :: Pt Double -> 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 :: [Ln Double] -> Path -- | Collapse line sequences into a single line. renderLines' :: [Ln Double] -> 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 Double) -> Image -> Image Over :: Image -> Image -> Image Empty :: Image -- | Layer one Image over another. over :: Image -> Image -> Image -- | List of Paths at Image. paths :: Image -> [Path] 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 -- | Statistics for all paths at Image. imageStatistics :: Image -> Statistics instance Eq Statistics instance Show Statistics instance Monoid 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 Double) 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 Double) -- | Locate the end point of the path. endPt :: Path -> Maybe (Pt Double) -- | 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 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 Double -> Pt Double -> Int -> [Ln Double] -- | 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 -> Double -> Path -- | Sierpinski triangle. sierpinski :: Pt Double -> Double -> Double -> Path -- | Top-level module for hps. module Graphics.PS