| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Waterfall.SVG.FromSVG
Synopsis
- data SVGErrorKind
- data SVGError = SVGError SVGErrorKind String
- convertPathCommands :: [PathCommand] -> Either SVGError [Path2D]
- parsePath :: String -> Either SVGError [Path2D]
- convertTransform :: Transformable2D a => Transformation -> Either SVGError (a -> a)
- convertTree :: Tree -> Either SVGError [Path2D]
- convertDocument :: Document -> Either SVGError [Path2D]
- readSVG :: FilePath -> IO (Either SVGError [Path2D])
Documentation
data SVGErrorKind Source #
Categories of error that may occur when processing an SVG
Instances
| Show SVGErrorKind Source # | |
Defined in Waterfall.SVG.FromSVG Methods showsPrec :: Int -> SVGErrorKind -> ShowS # show :: SVGErrorKind -> String # showList :: [SVGErrorKind] -> ShowS # | |
| Eq SVGErrorKind Source # | |
Defined in Waterfall.SVG.FromSVG | |
| Ord SVGErrorKind Source # | |
Defined in Waterfall.SVG.FromSVG Methods compare :: SVGErrorKind -> SVGErrorKind -> Ordering # (<) :: SVGErrorKind -> SVGErrorKind -> Bool # (<=) :: SVGErrorKind -> SVGErrorKind -> Bool # (>) :: SVGErrorKind -> SVGErrorKind -> Bool # (>=) :: SVGErrorKind -> SVGErrorKind -> Bool # max :: SVGErrorKind -> SVGErrorKind -> SVGErrorKind # min :: SVGErrorKind -> SVGErrorKind -> SVGErrorKind # | |
Type representing an error that occured when processing an SVG
Constructors
| SVGError SVGErrorKind String |
convertPathCommands :: [PathCommand] -> Either SVGError [Path2D] Source #
Generate Path2Ds from a parsed list of PathCommands.
Consective PathCommands will be merged into the same Path2D
unless either a move command (m, M) or a close path command (z, Z) is encountered.
parsePath :: String -> Either SVGError [Path2D] Source #
Parse SVG Path data
and convert it into a Path2D
convertTransform :: Transformable2D a => Transformation -> Either SVGError (a -> a) Source #
Parse a Transformation into a function that can be applied to
any Waterfall type with a Transformable2D instance
This should handle every case except for TransformUnknown