Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyrosenbluth committed Apr 8, 2014
1 parent d5af6b9 commit b17f897
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Diagrams/TwoD/Image.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ import Diagrams.TwoD.Types
import Data.AffineSpace ((.-.))
import Data.Semigroup

-- |
data Embedded deriving Typeable
data External deriving Typeable

-- |
-- | 'ImageData' is either a JuicyPixels @DynamicImage@ tagged as 'Embedded' or
-- a reference tagged as 'External'.
data ImageData :: * -> * where
ImageRaster :: DynamicImage -> ImageData Embedded
-- ^ DynamicImage is from JuicyPixels
ImageRef :: FilePath -> ImageData External

-------------------------------------------------------------------------------
Expand Down Expand Up @@ -89,12 +88,12 @@ image img = mkQD (Prim (img)) (getEnvelope r) (getTrace r) mempty
DImage _ w h _ = img
-- See Note [Image size specification]

-- | Make a Dynamic image into a Diagram, i.e a primitive of type DImage Embedded.
-- | Make a@DynamicImage@ into a 'Diagram', i.e a primitive of type 'DImage Embedded'.
mkImageRaster :: Renderable (DImage Embedded) b
=> DynamicImage -> Int -> Int -> Diagram b R2
mkImageRaster dImg w h = image $ DImage (ImageRaster dImg) w h mempty

-- | Make a Dynamic image into a Diagram, i.e a primitive of type DImage Embedded.
-- | Make a file path into a 'Diagram', i.e a primitive of type 'DImage External'.
-- This function calls @uncheckedImageRef@ and provides no guarantee that
-- the image file exists.
mkImageRef :: Renderable (DImage External) b
Expand Down

0 comments on commit b17f897

Please sign in to comment.