-- 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.2 module Graphics.PS.Matrix -- | Transformation matrix data type. data Matrix Matrix :: R -> R -> R -> R -> R -> R -> Matrix -- | The identity matrix. identity :: M -- | A translation matrix with independent x and y offsets. translation :: R -> R -> M -- | A scaling matrix with independent x and y scalars. scaling :: R -> R -> M -- | A rotation matrix through the indicated angle (in radians). rotation :: R -> M instance Eq MIx instance Show MIx instance Enum MIx instance Eq Matrix instance Show Matrix instance Num Matrix module Graphics.PS.Unit -- | Convert degrees to radians. radians :: Floating a => a -> a -- | Convert millimeters to PS points. mm_pt :: Floating a => a -> a module Graphics.PS.Paper -- | Paper size data type. data Paper Paper :: Int -> Int -> Paper width :: Paper -> Int height :: Paper -> Int -- | Swap width and height. landscape :: Paper -> Paper -- | A div variant that rounds rather than truncates. divRound :: Int -> Int -> Int -- | ISO size downscaling. iso_down_scale :: Paper -> Paper -- | ISO A sizes in millimeters. a1 :: Paper a2 :: Paper a3 :: Paper a4 :: Paper a5 :: Paper a6 :: Paper a7 :: Paper a8 :: Paper a9 :: Paper a10 :: Paper a0 :: Paper -- | ISO B sizes in millimeters. b1 :: Paper b2 :: Paper b3 :: Paper b4 :: Paper b5 :: Paper b6 :: Paper b7 :: Paper b8 :: Paper b9 :: Paper b10 :: Paper b0 :: Paper -- | ISO C sizes in millimeters. c1 :: Paper c2 :: Paper c3 :: Paper c4 :: Paper c5 :: Paper c6 :: Paper c7 :: Paper c8 :: Paper c9 :: Paper c10 :: Paper c0 :: Paper -- | US Letter size in millimeters. usLetter :: Paper instance Eq Paper instance Show Paper module Graphics.PS.GS data GS GS :: Color -> LineWidth -> LineCap -> LineJoin -> ([Int], Int) -> Double -> GS data LineCap ButtCap :: LineCap RoundCap :: LineCap ProjectingSquareCap :: LineCap data LineJoin MiterJoin :: LineJoin RoundJoin :: LineJoin BevelJoin :: LineJoin 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 GS instance Show GS instance Eq Color instance Show Color instance Eq LineJoin instance Show LineJoin instance Enum LineJoin instance Eq LineCap instance Show LineCap instance Enum LineCap 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 module Graphics.PS.Glyph -- | Character data type. type Glyph = Char module Graphics.PS.Pt -- | Point data type, component values are real. data Pt Pt :: Double -> Double -> Pt -- | Convert from polar to rectangular co-ordinates. polarToRectangular :: Pt -> Pt ptMin :: Pt -> Pt -> Pt ptMax :: Pt -> Pt -> Pt 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 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 module Graphics.PS.Path -- | Path data type, in cartesian space. data Path MoveTo :: Pt -> Path LineTo :: Pt -> Path CurveTo :: Pt -> Pt -> Pt -> Path Text :: Font -> [Glyph] -> Path PTransform :: Matrix -> Path -> Path Join :: Path -> Path -> Path -- | Infix notation for path join. (+++) :: Path -> Path -> Path -- | Line segments though list of points. line :: [Pt] -> Path -- | Line variant connecting last point to first point. polygon :: [Pt] -> Path -- | Rectangle of specified dimensions 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 transformation nodes. flatten :: Path -> Path instance Eq Path instance Show Path module Graphics.PS.Image -- | Image data type. 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 module Graphics.PS.Statistics -- | Path statistics data type. data Statistics Statistics :: Integer -> Integer -> Integer -> Integer -> Integer -> Statistics nMoveTo :: Statistics -> Integer nLineTo :: Statistics -> Integer nCurveTo :: Statistics -> Integer nGlyph :: Statistics -> Integer nTransform :: Statistics -> Integer -- | Determine number of path components of each type. pathStatistics :: Path -> Statistics module Graphics.PS.Transform translate :: Transformable a => Double -> Double -> a -> a scale :: Transformable a => Double -> Double -> a -> a rotate :: Transformable a => Double -> a -> a instance Transformable Pt instance Transformable Path instance Transformable Image module Graphics.PS.Query -- | Locate the starting point of the path. startPt :: Path -> Maybe Pt -- | Locate the end point of the path. endPt :: Path -> Maybe Pt -- | Ensure path begins with a MoveTo. mkValid :: Path -> Path -- | Approximate curves as straight lines. approx :: Double -> Path -> Path -- | Add a LineTo the start point of path. close :: Path -> Path module Graphics.PS.PS -- | Write a postscript file. The list of images are written one per page. ps :: String -> Paper -> [Image] -> IO () module Graphics.PS