Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image #173

Merged
merged 4 commits into from
Apr 9, 2014
Merged

Image #173

merged 4 commits into from
Apr 9, 2014

Conversation

jeffreyrosenbluth
Copy link
Member

This can be merged, I'm sure there is more to do but I have implemented the API
form #29 and checked it in cairo and rasterific.

Note Image has been renamed DImage - easier to work with Juicy Pixels, without constantly
qualifying imports.


makeLenses ''Image
-- |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add a comment here.

-- | An image primitive.
data DImage :: * -> * where
DImage :: ImageData t -> Int -> Int -> T2 -> DImage t
-- ^ width, height, applied transformation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dist/build/tmp-7144/src/Diagrams/TwoD/Image.hs:62:3:
parse error on input `-- ^ width, height, applied transformation'

Maybe you have to put this comment above DImage, using -- |?

-- | 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you say about simply getting rid of this function? Its name is uninformative, we don't particularly want to encourage its use, and it's just a simple composition of two other functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine with me.

@byorgey byorgey merged commit be551a4 into master Apr 9, 2014
@jeffreyrosenbluth jeffreyrosenbluth deleted the image branch May 3, 2014 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants