úÎAü>Á+      !"#$%&'()*None 'An Affine transformation from R2 to R2. [[Affine]] = R2 -> R2With the Monoid instance (identity, compose) [[compose a b]] = [[a]] . [[b]] [[apply a]] = [[a]] [[identity]] = id  [[inverse x]] = inverse [[x]]FIf the transformation is not invertible, this operation is undefined. [[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)lMultiply this Affine by the top of the OpenGL matrix stack. Don't mind this, it's an implementation detail.+ ,      + ,(c) Luke Palmer 2008-2010BSD3 Luke Palmer <lrpalmer@gmail.com> experimentaltested on GHC onlyNone*A Sprite represents a finite bitmap image. [[Sprite]] = [-1,1]^2 -> ColorjColor is defined in the usual computer graphics sense: a 4 vector containing red, green, blue, and alpha.AThe Monoid instance is given by alpha composition, described at Fhttp://lukepalmer.wordpress.com/2010/02/05/associative-alpha-blending/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 1The type of images. [[Image a]] = R2 -> (Color, a)7The semantics of the instances are all consistent with type class morphismC. I.e. Functor, Applicative, and Monoid act point-wise, using the  monoid described below.¤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 q, but clears the screen first. This is so you can use this module and pretend that OpenGL doesn't exist at all.)Sample the value of the image at a point. [[sample i p]] = snd ([[i]] p)(A single "pixel" at the specified point. c[[point p]] r | [[r]] == [[p]] = (one, Any True) | otherwise = (zero, Any False)'A line connecting the two given points.6A regular polygon centered at the origin with n sides.CAn (imperfect) unit circle centered at the origin. Implemented as: circle = regularPoly 24-A convex polygon given by the list of points. ÇA Bezier curve given a list of control points. It is a curve that begins at the first point in the list, ends at the last one, and smoothly interpolates between the rest. It is the empty image (") if zero or one points are given.!Transform an image by an  transformation. %[[tr % im]] = [[im]] . inverse [[tr]]""Modulate two colors by each other. Zmodulate (Color r g b a) (Color r' g' b' a') = Color (r*r') (g*g') (b*b') (a*a')#KTint an image by a color; i.e. modulate the colors of an image by a color. M[[tint c im]] = first (modulate c) . [[im]] where first f (x,y) = (f x, y)$8Load an image from a file and create a sprite out of it.%$The image of a sprite at the origin. o[[sprite s]] p | p `elem` [-1,1]^2 = ([[s]] p, Any True) | otherwise = (zero, Any False)&”The image representing some text rendered with a font. The baseline is at y=0, the text starts at x=0, and the height of a lowercase x is 1 unit.'Load a TTF font from a file.jWARNING: This is unsafe due to the finalizer possibly running earlier than expected See discussion at: Xhttp://hackage.haskell.org/package/base-4.8.0.0/docs/System-Mem-Weak.html#v:addFinalizer)textWidth font str is the width of the text in  text font str.*ÿ_Import an OpenGL action and pure sampler function into an Image. This ought to be a well-behaved, compositional action (make sure it responds to different initial ModelViews, don't change matrix modes or render or anything like that). The color given to the action is the current tint color; modulate all your colors by this before setting them.*-./012345678 !9"#$%&:'()*;<=>+  !"#$%&'()*! "#$%'&)(*"-./012345678 !9"#$%&:'()*;<=>!?       !"#$%&'()*+,-./0123456789:;<=>?!graphics-drawingcombinators-1.5.1Graphics.DrawingCombinators"Graphics.DrawingCombinators.Affinebase Data.MonoidmconcatmappendmemptyMonoidgetAnyAnyAffineR2Rcomposeapplyidentityinverse translaterotatescale multGLmatrixwithMultGLmatrixFontSpriteColorImagerender clearRendersamplepointline regularPolycircle convexPoly bezierCurve%%modulatetint openSpritespritetextopenFontwithFont textWidthunsafeOpenGLImageM$fMonoidAffinegetFont spriteObjectdRenderdPickPickerRenderertoVertex toVertex3withoutTextureswhite renderText $fMonoidColor $fMonoidImage$fApplicativeImage$fFunctorImage