úÎ9°6©#      !" *An Affine transformation from R2 to R2.   [Affine] = R2 -> R2 The Monoid instance (identity, compose) # ! [[compose a b]] = [[a]] . [[b]]   [[apply a]] = [[a]]   [[identity]] = id $  [[inverse x]] = inverse [[x]]  ! [[translate t]] x = [[t]] x + t  = [[rotate r]] (x,y) = (cos(r)x - sin(r)y, sin(r)x + cos(r)y)  & [[scale xs ys]] (x,y) = (xs*x, ys*y)   needs GADTs and rank n types experimental Luke Palmer <lrpalmer@gmail.com>0 %& =Indicate how a non-square image is to be mapped to a sprite. WScaleHeight will set the height of the image to 1, and scale the width appropriately. UScaleWidth will set the width of the image to 1, and scale the height appropriately. IScaleMax will set the maximum of the height and width of the image to 1. $A Sprite represents a bitmap image.  [[Sprite]] = [-1,1]^2 -> Color '()*+,;Color is defined in the usual computer graphics sense, of 4 a 4 vector containing red, green, blue, and alpha. =The Monoid instance is given by alpha transparency blending,  so:   mempty = Color 1 1 1 1 @ mappend c@(Color _ _ _ a) c'@(Color _ _ _ a') = a*c + (1-a)*c' <Where multiplication is componentwise. In the semantcs the  values zero and one! are used, which are defined as:  zero = Color 0 0 0 0  one = Color 1 1 1 1 The type of images.  [[Image a]] = R2 -> (Color, a) -./01=Draw an Image on the screen in the current OpenGL coordinate = system (which, in absense of information, is (-1,-1) in the + lower left and (1,1) in the upper right). Like render*, but clears the screen first. This is so 6 you can use this module and pretend that OpenGL doesn't  exist at all. 2KGiven a bounding box, lower left and upper right in the default coordinate 4 system (-1,-1) to (1,1), return the topmost drawing's value (with respect to  over") intersecting that bounding box. ,Sample the value of the image at a point. $ [[sample p i]] = snd ([[i]] [[p]]) EPerform initialization of the library. This can throw an exception. 345'A single pixel at the specified point. 3 [[point p]] r | [[r]] == [[p]] = (one, Any True) 4 | otherwise = (zero, Any False) (A line connecting the two given points. 7A regular polygon centered at the origin with n sides. DAn (imperfect) unit circle centered at the origin. Implemented as:  circle = regularPoly 24 .A convex polygon given by the list of points. Transform an image by an  transformation. ' [[tr % im]] = [[im]] . inverse [[tr]] #Modulate two colors by each other. / modulate (Color r g b a) (Color r' g' b' a') / = Color (r*r') (g*g') (b*b') (a*a') CTint an image by a color; i.e. modulate the colors of an image by  a color. - [[tint c im]] = first (modulate c) . [[im]] # where first f (x,y) = (f x, y) 678$Convert an SDL.Surface to a Sprite. 99Load an image from a file and create a sprite out of it. %The image of a sprite at the origin. ; [[sprite s]] p | p `elem` [-1,1]^2 = ([[s]] p, Any True) 8 | otherwise = (zero, Any False) !FLoad a TTF font from a file with the given point size (higher numbers 3 mean smoother text but more expensive rendering). :"GThe image representing some text rendered with a font. The resulting  string will have height 1. #  !"  !"   !";      !"#$%& '()*+,-./0123456789:!graphics-drawingcombinators-1.0.3"Graphics.DrawingCombinators.AffineGraphics.DrawingCombinatorsAffineR2Rcomposeapplyidentity translaterotatescaleFont SpriteScaling ScaleHeight ScaleWidthScaleMaxSpriteColorImagerender clearRendersampleinitpointline regularPolycircle convexPoly%%modulatetintsurfaceToSprite imageToSpritespriteopenFonttextMinversegetFont spriteObjectspriteWidthRatspriteHeightRat spriteWidth spriteHeightdRenderdPickPickerRenderer selectRegiontoVertexinSetpicker textureHackallocateTexture freeTexture padSurface textSprite