Commit 17ea06b0 authored by Peter Achten's avatar Peter Achten

moved files deleted

parent 7f69cfce
definition module Graphics.Scalable
/** A proposal for a compositional image library for defining SVG-images.
Peter Achten
Jurrien Stutterheim
Rinus Plasmeijer
*/
from Graphics.Scalable.Internal import :: Image, :: ImageTag, :: Span, :: ImageSpan (..),
:: FontDef {..}, :: ImageOffset, :: Angle, :: Markers {..}, :: ImageAttr,
:: StrokeAttr {..}, :: StrokeWidthAttr {..}, :: XRadiusAttr {..},
:: YRadiusAttr {..}, :: FillAttr {..}, :: OpacityAttr {..},
:: OnClickAttr {..}, :: OnMouseDownAttr {..}, :: OnMouseUpAttr {..},
:: OnMouseOverAttr {..}, :: OnMouseMoveAttr {..}, :: OnMouseOutAttr {..},
:: DraggableAttr {..}, :: DashAttr {..}, :: NoAttr (..),
:: MaskAttr {..}, :: Slash (..), :: XYAlign, :: XAlign (..), :: YAlign (..),
:: Host (..), :: GridLayout, :: GridMajor(..), :: GridXLayout (..), :: GridYLayout (..), :: GridDimension (..),
class /. (..), class *. (..), instance *. Span, instance /. Span,
instance + Span, instance - Span, instance zero Span, instance ~ Span
from StdOverloaded import class zero (..), class + (..), class - (..),
class ~ (..), class sign (..), class abs (..), class < (..), class == (..),
class toReal (..), class / (..), class * (..)
from Data.Maybe import :: Maybe (..)
from Text.HTML import :: SVGColor
from Data.Set import :: Set
import Math.Geometry
px :: !Real -> Span // (px a) is a pixels
textxspan :: !FontDef !String -> Span // (textxspan font str) is the x-span of str written in font
imagexspan :: !ImageTag -> Span // (imagexspan ts) is x-span of image tagged with superset of ts
imageyspan :: !ImageTag -> Span // (imageyspan ts) is y-span of image tagged with superset of ts
columnspan :: !ImageTag !Int -> Span // (columnspan ts i) is x-span of column i in grid tagged with superset of ts
rowspan :: !ImageTag !Int -> Span // (rowspan ts i) is y-span of row i in grid tagged with superset of ts
minSpan :: ![Span] -> Span // (minimum as) is the minimum of as (zero if as = [])
maxSpan :: ![Span] -> Span // (maximum as) is the maximum of as (zero if as = [])
class margin a where
margin :: !a !(Image m) -> Image m
instance margin Span // Margin is the same span on all sides
instance margin (!Span, !Span) // (h, v) Margin is h on top and bottom and v on left and right
instance margin (!Span, !Span, !Span) // (t, h, b) Margin is t on top, v on left and right and b on bottom
instance margin (!Span, !Span, !Span, !Span) // (t, r, b, l) Margin is t on top, r on the right, b on the bottom and l on the left
normalFontDef :: !String !Real -> FontDef // (normalFontDef family size) sets all other fields to "normal"
empty :: !Span !Span -> Image m // (empty a b) is an empty image with x-span a and y-span b
text :: !FontDef !String -> Image m // (text font str) is an image containg str written in font
circle :: !Span -> Image m // (circle a) is an image of a circle with diameter a
ellipse :: !Span !Span -> Image m // (ellipse a b) is an image of an ellipse with x-diameter a and y-diameter b
rect :: !Span !Span -> Image m // (rect a b) is an image of a rectangle with x-span a and y-span b
raw :: !Span !Span !String -> Image m
defaultMarkers :: Markers m
xline :: !(Maybe (Markers m)) !Span -> Image m // (xline a) is an image of a line with x-span a and y-span zero
yline :: !(Maybe (Markers m)) !Span -> Image m // (yline a) is an image of a line with y-span a and x-span zero
line :: !(Maybe (Markers m)) !Slash !Span !Span -> Image m // (line a b) is an image of a line with x-span a and y-span b
polygon :: !(Maybe (Markers m)) ![ImageOffset] -> Image m // (polygon xs) is an image of a polygon with coordinates xs
polyline :: !(Maybe (Markers m)) ![ImageOffset] -> Image m // (polyline xs) is an image of a polyline with coordinates xs
fit :: !Span !Span !(Image m) -> Image m
fitx :: !Span !(Image m) -> Image m
fity :: !Span !(Image m) -> Image m
scale :: !Real !Real !(Image m) -> Image m
scalex :: !Real !(Image m) -> Image m
scaley :: !Real !(Image m) -> Image m
rotate :: !Angle !(Image m) -> Image m
flipx :: !(Image m) -> Image m
flipy :: !(Image m) -> Image m
skewx :: !Angle !(Image m) -> Image m
skewy :: !Angle !(Image m) -> Image m
overlay :: ![XYAlign] ![ImageOffset] ![Image m] !(Host m) -> Image m
beside :: ![YAlign] ![ImageOffset] ![Image m] !(Host m) -> Image m
above :: ![XAlign] ![ImageOffset] ![Image m] !(Host m) -> Image m
grid :: !GridDimension !GridLayout ![XYAlign] ![ImageOffset] ![Image m] !(Host m) -> Image m
collage :: ![ImageOffset] ![Image m] !(Host m) -> Image m
instance < (ImageAttr m)
instance == (ImageAttr m)
class tuneImage attr :: !(Image m) !(attr m) -> Image m
(<@<) infixl 2 :: !(Image m) !(attr m) -> Image m | tuneImage attr
(>@>) infixr 2 :: !(attr m) !(Image m) -> Image m | tuneImage attr
tuneIf :: !Bool !(Image m) !(attr m) -> Image m | tuneImage attr
instance tuneImage StrokeAttr, StrokeWidthAttr, FillAttr, OpacityAttr,
OnClickAttr, OnMouseDownAttr, OnMouseUpAttr, OnMouseOverAttr,
OnMouseMoveAttr, OnMouseOutAttr, DraggableAttr, XRadiusAttr, YRadiusAttr,
DashAttr, MaskAttr, NoAttr
class toSVGColor a :: !a -> SVGColor
instance toSVGColor String, RGB
instance zero RGB
:: RGB = { r :: !Int, g :: !Int, b :: !Int }
instance == ImageTag
instance < ImageTag
:: *TagSource :== *[TagRef]
:: *TagRef :== *(!ImageTag, !*ImageTag)
tag :: !*ImageTag !(Image m) -> Image m
tagWithSrc :: !*TagSource !(Image m) -> *(!(!Image m, !ImageTag), !*TagSource)
instance + ImageOffset
instance == FontDef
instance < FontDef
This diff is collapsed.
definition module Graphics.Scalable.Internal
from Data.Maybe import :: Maybe
from Text.HTML import :: SVGColor
from Data.Set import :: Set
from Math.Geometry import :: Angle
from StdOverloaded import class zero, class +, class -, class ~, class sign, class abs, class <, class ==, class toReal, class /, class *
:: Image m
= { content :: !ImageContent m // the image elements
, mask :: !Maybe (Image m) // the mask image
, attribs :: !Set (ImageAttr m) // the image attributes
, transform :: ![ImageTransform] // [t_1, ..., t_n] transforms the image as t_1 o ... o t_n
, tags :: !Set ImageTag // set of tags
, uniqId :: !Int // A unique identifier for this image
// TODO Get rid of the next two fields
, totalSpanPreTrans :: !ImageSpan // Total image span before transformations
, transformCorrection :: !ImageOffset // Correction required after transformation
}
:: ImageTransform
= RotateImage !Angle
| SkewXImage !Angle
| SkewYImage !Angle
| FitImage !Span !Span
| FitXImage !Span
| FitYImage !Span
| ScaleImage !Real !Real
| ScaleXImage !Real
| ScaleYImage !Real
| FlipXImage
| FlipYImage
:: ImageContent m
= Basic !BasicImage !ImageSpan
| Line !(LineImage m)
| Composite !(CompositeImage m)
:: LineImage m
= { lineSpan :: !ImageSpan
, markers :: !Maybe (Markers m)
, lineContent :: !LineContent
}
:: Markers m
= { markerStart :: !Maybe (Image m)
, markerMid :: !Maybe (Image m)
, markerEnd :: !Maybe (Image m)
}
:: LineContent
= SimpleLineImage !Slash
| PolygonImage ![ImageOffset]
| PolylineImage ![ImageOffset]
:: Span
= PxSpan !Real // (PxSpan a) is a pixels
| LookupSpan !LookupSpan // (LookupSpan a) needs to be looked up after computing dimensions
| AddSpan !Span !Span // (AddSpan a b) is span a + span b
| SubSpan !Span !Span // (SubSpan a b) is span a - span b
| MulSpan !Span !Span // (MulSpan a b) is span a * span k
| DivSpan !Span !Span // (DivSpan a b) is span a / span k
| AbsSpan !Span // (AbsSpan a) is absolute value of span a
| MinSpan ![Span] // (MinSpan as) is minimum span value in as
| MaxSpan ![Span] // (MaxSpan as) is maximum span value in as
:: ImageSpan :== (!Span, !Span)
:: BasicImage
= EmptyImage
| TextImage !FontDef !String
| CircleImage
| RectImage
| EllipseImage
| RawImage !String
:: FontDef
= { fontfamily :: !String
, fontysize :: !Real
, fontstretch :: !String
, fontstyle :: !String
, fontvariant :: !String
, fontweight :: !String
}
:: CompositeImage m
= { host :: !Host m
, compose :: !Compose m
}
:: LookupSpan
= ColumnXSpan !ImageTag !Int // (ColumnXSpan as a) is x-span of column number a in grid tagged with superset of as
| RowYSpan !ImageTag !Int // (RowYSpan as a) is y-span of row number a in grid tagged with superset of as
| ImageXSpan !ImageTag // (ImageXSpan as) is x-span of image tagged with superset of as
| ImageYSpan !ImageTag // (ImageYSpan as) is y-span of image tagged with superset of as
| TextXSpan !FontDef !String // (TextXSpan a b) is width of text b written in font a
:: GridDimension = Rows !Int | Columns !Int
:: GridLayout :== (!GridMajor, !GridXLayout, !GridYLayout)
:: GridMajor = ColumnMajor | RowMajor
:: GridXLayout = LeftToRight | RightToLeft
:: GridYLayout = TopToBottom | BottomToTop
:: XAlign
= AtLeft
| AtMiddleX
| AtRight
:: YAlign
= AtTop
| AtMiddleY
| AtBottom
:: XYAlign :== (!XAlign, !YAlign)
:: Compose m
= AsGrid !(!Int, !Int) ![[ImageOffset]] ![[XYAlign]] ![[Image m]] // (AsGrid (noOfCols, noOfRows) alignments) composes elements in rows, using alignments per image
| AsCollage ![ImageOffset] ![Image m] // AsCollage composes elements in freestyle, framed in optional host
| AsOverlay ![ImageOffset] ![XYAlign] ![Image m] // AsOverlay composes elements, framed in optional host or largest spans
:: ImageAttr m
= ImageStrokeAttr !(StrokeAttr m)
| ImageStrokeWidthAttr !(StrokeWidthAttr m)
| ImageXRadiusAttr !(XRadiusAttr m)
| ImageYRadiusAttr !(YRadiusAttr m)
| ImageStrokeOpacityAttr !(OpacityAttr m)
| ImageFillOpacityAttr !(OpacityAttr m)
| ImageFillAttr !(FillAttr m)
| ImageDashAttr !(DashAttr m)
| ImageOnClickAttr !(OnClickAttr m)
| ImageOnMouseDownAttr !(OnMouseDownAttr m)
| ImageOnMouseUpAttr !(OnMouseUpAttr m)
| ImageOnMouseOverAttr !(OnMouseOverAttr m)
| ImageOnMouseMoveAttr !(OnMouseMoveAttr m)
| ImageOnMouseOutAttr !(OnMouseOutAttr m)
| ImageDraggableAttr !(DraggableAttr m)
:: StrokeAttr m = { stroke :: !SVGColor }
:: StrokeWidthAttr m = { strokewidth :: !Span }
:: XRadiusAttr m = { xradius :: !Span }
:: YRadiusAttr m = { yradius :: !Span }
:: OpacityAttr m = { opacity :: !Real }
:: FillAttr m = { fill :: !SVGColor }
:: DashAttr m = { dash :: ![Int] }
:: OnClickAttr m = { onclick :: !(Int m -> m), local :: !Bool }
:: OnMouseDownAttr m = { onmousedown :: !(m -> m), local :: !Bool }
:: OnMouseUpAttr m = { onmouseup :: !(m -> m), local :: !Bool }
:: OnMouseOverAttr m = { onmouseover :: !(m -> m), local :: !Bool }
:: OnMouseMoveAttr m = { onmousemove :: !(m -> m), local :: !Bool }
:: OnMouseOutAttr m = { onmouseout :: !(m -> m), local :: !Bool }
:: DraggableAttr m = { draggable :: !Maybe ((Maybe (Set ImageTag)) Real Real m -> m) }
:: MaskAttr m = { mask :: !Image m }
:: NoAttr m = NoAttr
:: ImageTag
= ImageTagUser !Int !String
| ImageTagSystem !Int
:: ImageOffset :== (!Span, !Span)
:: Host m = NoHost | Host (Image m)
:: Slash = Slash | Backslash
class (*.) infixl 7 a :: !a !n -> Span | toReal n
class (/.) infixl 7 a :: !a !n -> Span | toReal n
instance zero Span
instance + Span
instance - Span
instance abs Span
instance ~ Span
instance *. Span, Real, Int
instance * Span
instance /. Span, Real, Int
instance / Span
implementation module Graphics.Scalable.Internal
import Graphics.Scalable.Internal
from StdMisc import abort
from StdFunc import flip
from StdTuple import fst, snd
from StdOrdList import minList, maxList
from StdOverloaded import class toReal
import Data.List
import Data.Maybe
from Data.Set import :: Set, instance == (Set a), instance < (Set a)
from StdBool import &&
import qualified Data.Set as DS
import Text.HTML
from Data.Functor import class Functor (..)
import Data.Generics.GenLexOrd
instance / Span where
/ p=:(PxSpan 0.0) _ = p
/ _ p=:(PxSpan 0.0) = p // Division by zero should be undefined, but that would be impractical
/ l (PxSpan 1.0) = l // Identity
/ (PxSpan l) (PxSpan r) = PxSpan (l / r)
/ (MulSpan a (PxSpan l)) (PxSpan r) = MulSpan a (PxSpan (l / r))
/ (DivSpan a (PxSpan l)) (PxSpan r) = DivSpan a (PxSpan (l * r))
/ (MaxSpan xs) r=:(PxSpan _) = MaxSpan (strictTRMap (\x -> x / r) xs)
/ (MinSpan xs) r=:(PxSpan _) = MinSpan (strictTRMap (\x -> x / r) xs)
/ l=:(PxSpan _) (MaxSpan xs) = MaxSpan (strictTRMap (\x -> l / x) xs)
/ l=:(PxSpan _) (MinSpan xs) = MinSpan (strictTRMap (\x -> l / x) xs)
/ l r = DivSpan l r
instance * Span where
* p=:(PxSpan 0.0) _ = p
* _ p=:(PxSpan 0.0) = p
* (PxSpan 1.0) r = r // Identity
* l (PxSpan 1.0) = l // Identity
* (PxSpan a) (PxSpan b) = PxSpan (a * b)
* (PxSpan a) (MulSpan (PxSpan b) c) = MulSpan c (PxSpan (a * b)) // Associativity
* (PxSpan a) (MulSpan b (PxSpan c)) = MulSpan b (PxSpan (a * c)) // Associativity + commutativity
* (MulSpan a (PxSpan b)) (PxSpan c) = MulSpan a (PxSpan (b * c)) // Associativity
* (MulSpan (PxSpan a) b) (PxSpan c) = MulSpan b (PxSpan (a * c)) // Associativity + commutativity
* (DivSpan (PxSpan a) b) (PxSpan c) = DivSpan (PxSpan (a * c)) b
* (DivSpan a (PxSpan b)) (PxSpan c) = MulSpan a (PxSpan (c / b))
* (PxSpan c) (DivSpan (PxSpan a) b) = DivSpan (PxSpan (a * c)) b
* (PxSpan c) (DivSpan a (PxSpan b)) = MulSpan a (PxSpan (c / b))
* (DivSpan a b) (DivSpan c d) = DivSpan (a * c) (b * d)
* (MaxSpan xs) r=:(PxSpan _) = MaxSpan (strictTRMap (\x -> x * r) xs)
* (MinSpan xs) r=:(PxSpan _) = MinSpan (strictTRMap (\x -> x * r) xs)
* l=:(PxSpan _) (MaxSpan xs) = MaxSpan (strictTRMap (\x -> x * l) xs)
* l=:(PxSpan _) (MinSpan xs) = MinSpan (strictTRMap (\x -> x * l) xs)
* l r = MulSpan l r
instance zero Span where
zero = PxSpan zero
instance abs Span where
abs (PxSpan x) = PxSpan (abs x)
abs (AbsSpan x) = AbsSpan x
abs (MaxSpan xs) = MaxSpan (strictTRMap abs xs)
abs (MinSpan xs) = MinSpan (strictTRMap abs xs)
abs span = AbsSpan span
instance ~ Span where
~ s = zero - s
instance + Span where
+ (PxSpan 0.0) b = b // Identity
+ a (PxSpan 0.0) = a // Identity
+ (PxSpan a) (PxSpan b) = PxSpan (a + b)
+ (PxSpan a) (AddSpan (PxSpan b) c) = AddSpan c (PxSpan (a + b)) // Associativity
+ (PxSpan a) (AddSpan b (PxSpan c)) = AddSpan b (PxSpan (a + c)) // Associativity + commutativity
+ (AddSpan a (PxSpan b)) (PxSpan c) = AddSpan a (PxSpan (b + c)) // Associativity
+ (AddSpan (PxSpan a) b) (PxSpan c) = AddSpan b (PxSpan (a + c)) // Associativity + commutativity
+ (SubSpan a b=:(PxSpan _)) c=:(PxSpan _) = SubSpan (a + c) b
+ (SubSpan (PxSpan a) b) (PxSpan c) = SubSpan (PxSpan (a + c)) b
+ a=:(PxSpan _) (SubSpan b c=:(PxSpan _)) = SubSpan (a + b) c
+ (PxSpan a) (SubSpan (PxSpan b) c) = SubSpan (PxSpan (a + b)) c
+ (DivSpan a l=:(PxSpan b)) (DivSpan c r=:(PxSpan d))
| b == d = DivSpan (a + c) l
| otherwise = DivSpan ((l * c) + (r * a)) (PxSpan (b * d))
+ (MulSpan p=:(PxSpan a) b) (MulSpan (PxSpan c) d)
| a == c = MulSpan p (b + d)
+ (MulSpan a p=:(PxSpan b)) (MulSpan (PxSpan c) d)
| b == c = MulSpan p (a + d)
+ (MulSpan p=:(PxSpan a) b) (MulSpan c (PxSpan d))
| a == d = MulSpan p (b + c)
+ (MulSpan a p=:(PxSpan b)) (MulSpan c (PxSpan d))
| b == d = MulSpan p (a + c)
+ l=:(PxSpan _) (MaxSpan xs) = MaxSpan (strictTRMap (\x -> x + l) xs)
+ (MaxSpan xs) r=:(PxSpan _) = MaxSpan (strictTRMap (\x -> x + r) xs)
+ s t = AddSpan s t
instance - Span where
- a (PxSpan 0.0) = a // Identity
- (PxSpan a) (PxSpan b) = PxSpan (a - b)
- (AddSpan a (PxSpan b)) (PxSpan c) = AddSpan a (PxSpan (b - c))
- (AddSpan (PxSpan a) b) (PxSpan c) = AddSpan b (PxSpan (a - c))
- (PxSpan c) (AddSpan a (PxSpan b)) = SubSpan (PxSpan (c - b)) a
- (PxSpan c) (AddSpan (PxSpan a) b) = SubSpan (PxSpan (c - a)) b
- (DivSpan a p=:(PxSpan b)) (DivSpan c (PxSpan d))
| b == d = DivSpan (a - c) p
- (MaxSpan xs) r=:(PxSpan _) = MaxSpan (strictTRMap (\x -> x - r) xs)
- l=:(PxSpan _) (MaxSpan xs) = MaxSpan (strictTRMap (\x -> l - x) xs)
- s t = SubSpan s t
instance *. Int where
*. l r = PxSpan (toReal l * toReal r)
instance *. Real where
*. l r = PxSpan (l * toReal r)
instance *. Span where
*. (PxSpan a) k = PxSpan (a * toReal k)
*. (MulSpan (PxSpan k1) a) k = MulSpan a (PxSpan (toReal k * k1))
*. (MulSpan a (PxSpan k1)) k = MulSpan a (PxSpan (toReal k * k1))
*. (DivSpan a (PxSpan k1)) k = MulSpan a (PxSpan (toReal k / k1))
*. (MaxSpan xs) k = MaxSpan (strictTRMap (\x -> x *. k) xs)
*. (MinSpan xs) k = MinSpan (strictTRMap (\x -> x *. k) xs)
*. s k = MulSpan s (PxSpan (toReal k))
instance /. Int where
/. l r = PxSpan (toReal l / toReal r)
instance /. Real where
/. l r = PxSpan (l / toReal r)
instance /. Span where
/. (PxSpan a) k = PxSpan (a / toReal k)
/. (MulSpan a (PxSpan k1)) k = MulSpan a (PxSpan (k1 / toReal k))
/. (DivSpan a (PxSpan k1)) k = DivSpan a (PxSpan (k1 * toReal k))
/. (MaxSpan xs) k = MaxSpan (strictTRMap (\x -> x /. k) xs)
/. (MinSpan xs) k = MinSpan (strictTRMap (\x -> x /. k) xs)
/. s k = DivSpan s (PxSpan (toReal k))
definition module Graphics.Scalable.Internal.Image
from Data.Maybe import :: Maybe
from Data.Set import :: Set
from Data.Map import :: Map
from Data.Error import :: MaybeError (..)
from Math.Geometry import :: Angle
from StdOverloaded import class zero (..), class + (..), class - (..), class ~ (..), class sign (..),
class abs (..), class < (..), class == (..), class toReal (..), class / (..), class * (..)
import Graphics.Scalable.Types
import Graphics.Scalable.Internal.Types
:: Image` m :== TextSpans [ImgTagNo] -> (Img, ImgEventhandlers m, ImgTexts, ImgMasks, ImgSpans, GridSpans, ImgTags, [ImgTagNo])
:: TextSpans :== Map FontDef (FontDescent, Map String TextSpan) // of each font, the font descent and of each text the width
:: ImgEventhandlers m :== Map ImgTagNo [ImgEventhandler m] // the registered event handlers of the image identified by the id (once registered, an event handler can not be overruled)
:: ImgTexts :== Map FontDef (Set String) // of each font, the collection of texts
:: ImgMasks :== Map ImgTagNo Img // of each mask, the mask-image (associate the id with (MaskImg id))
:: ImgSpans :== Map ImgTagNo ImageSpan // of each image, its (width,height)
:: GridSpans :== Map ImgTagNo GridSpan // of each grid, the spans of its columns and the spans of its rows
:: ImgTags :== Map ImageTag ImgTagNo // map user-tag to system number
:: FontDescent :== Real
:: TextSpan :== Real
:: ImgEventhandler m
= ImgEventhandlerOnClickAttr !(OnClickAttr m)
| ImgEventhandlerOnMouseDownAttr !(OnMouseDownAttr m)
| ImgEventhandlerOnMouseUpAttr !(OnMouseUpAttr m)
| ImgEventhandlerOnMouseOverAttr !(OnMouseOverAttr m)
| ImgEventhandlerOnMouseMoveAttr !(OnMouseMoveAttr m)
| ImgEventhandlerOnMouseOutAttr !(OnMouseOutAttr m)
| ImgEventhandlerDraggableAttr !(DraggableAttr m)
:: GridSpan
= { col_spans :: ![Span]
, row_spans :: ![Span]
}
:: Img
= { uniqId :: !ImgTagNo // the unique system identification within the entire image
, host :: !HostImg // the host of this image
, transform :: !Maybe ImgTransform // the optional transform of the basic/composite image
, overlays :: ![Img] // the back-to-front ordering of images 'on top of' host
, offsets :: ![ImageOffset] // the offsets matching one-by-one with .overlays
}
:: HostImg
= BasicHostImg !BasicImg !(Set BasicImgAttr)
| RawHostImg !String
| CompositeImg !Img
:: BasicImg
= EmptyImg
| TextImg !FontDef !String
| CircleImg
| RectImg
| EllipseImg
| PolylineImg !LineMarkers ![ImageOffset]
| PolygonImg !LineMarkers ![ImageOffset]
:: LineMarkers
= { lineStart :: !Maybe Img
, lineMid :: !Maybe Img
, lineEnd :: !Maybe Img
}
:: BasicImgAttr // attributes that are applicable only on basic images
= BasicImgStrokeAttr !SVGColor
| BasicImgStrokeWidthAttr !Span
| BasicImgXRadiusAttr !Span
| BasicImgYRadiusAttr !Span
| BasicImgStrokeOpacityAttr !Real
| BasicImgFillOpacityAttr !Real
| BasicImgFillAttr !SVGColor
| BasicImgDashAttr ![Int]
:: ImgTransform
= RotateImg !Angle
| SkewXImg !Angle
| SkewYImg !Angle
| FitImg !Span !Span
| FitXImg !Span
| FitYImg !Span
| ScaleImg !Real !Real
| FlipXImg
| FlipYImg
| MaskImg !ImgTagNo // the id-img pair is stored in the ImgMasks table
:: Host` m
= NoHost`
| Host` (Image` m)
:: Markers` m
= { markerStart` :: !Maybe (Image` m)
, markerMid` :: !Maybe (Image` m)
, markerEnd` :: !Maybe (Image` m)
}
tag` :: !*ImageTag !(Image` m) -> Image` m
tagWithSrc` :: !*TagSource !(Image` m) -> *(!(!Image` m, !ImageTag), !*TagSource)
empty` :: !Span !Span !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
text` :: !FontDef !String !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
circle` :: !Span !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
ellipse` :: !Span !Span !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
rect` :: !Span !Span !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
raw` :: !Span !Span !String !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
polyline` :: !(Markers` m) ![ImageOffset] !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
polygon` :: !(Markers` m) ![ImageOffset] !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
fit` :: !Span !Span !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
fitx` :: !Span !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
fity` :: !Span !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
scale` :: !Real !Real !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
rotate` :: !Angle !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
flipx` :: !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
flipy` :: !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
skewx` :: !Angle !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
skewy` :: !Angle !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
mask` :: !(Image` m) !(Image` m) !TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
grid` :: !GridDimension !GridLayout ![XYAlign] ![Span] ![Span] ![ImageOffset] ![Image` m] !(Host` m)
!TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
overlay` :: ![XYAlign] ![ImageOffset] ![Image` m] !(Host` m)
!TextSpans ![ImgTagNo] -> (!Img,!ImgEventhandlers m,!ImgTexts,!ImgMasks,!ImgSpans,!GridSpans,!ImgTags,![ImgTagNo])
tuneAttr` :: !(Image` m) !BasicImgAttr -> Image` m
tuneHandler` :: !(Image` m) !(ImgEventhandler m) -> Image` m
:: SpanResolveError :== String
resolve_spans :: !ImgTags !TextSpans !Img !ImgMasks !ImgSpans !GridSpans -> MaybeError SpanResolveError (!Img,!ImgMasks,!ImgSpans,!GridSpans)
// only for testing purposes:
//dummyTextSpans :: ImgTexts -> TextSpans
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment