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

Image2 #174

Merged
merged 6 commits into from
Apr 9, 2014
Merged

Image2 #174

merged 6 commits into from
Apr 9, 2014

Conversation

jeffreyrosenbluth
Copy link
Member

I think this is simpler and better. You can ignore the comments in the pull request for image.
I kept uncheckedImageRef since we need to cache the width and height in loadImageExt anyway so that backends can use them, but the user does not need to provide them explicitly when using the load functions.

There is a companion rasterific branch, but the original cairo image branch works as is.

@jeffreyrosenbluth
Copy link
Member Author

Here is how you would use the rasterific api.
From KnightTour:

 main = do
    d <- loadImageEmb "white-knight.png"
    let img = case d of
               Left e -> error $ show e
               Right d' -> image d' # scaleUToX 1 
   mainWith $ example img

and in cairo

 main = do
    d <- loadImageExt "white-knight.png"
    let img = case d of
               Left e -> error $ show e
               Right d' -> image d' # scaleUToX 1
    mainWith $ example img # pad 1.1

@byorgey
Copy link
Member

byorgey commented Apr 9, 2014

Yes, I like this better too.

@jeffreyrosenbluth
Copy link
Member Author

Great, I'm inclined to merge and revisit images after fixpoint.
Mainly becuase I want to release a fully featured rasterific backend,
which depends on image2

On Wed, Apr 9, 2014 at 10:27 AM, Brent Yorgey notifications@github.comwrote:

Yes, I like this better too.

Reply to this email directly or view it on GitHubhttps://github.com//pull/174#issuecomment-39970081
.

byorgey added a commit that referenced this pull request Apr 9, 2014
@byorgey byorgey merged commit 2001f76 into master Apr 9, 2014
@byorgey byorgey deleted the image2 branch April 9, 2014 15:38
uncheckedImageRef path w h = DImage (ImageRef path) w h mempty

-- | Crate a diagram from raw raster data.
fromRaster :: Renderable (DImage Embedded) b
Copy link
Member

Choose a reason for hiding this comment

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

I merged because it wasn't worth holding it up over more bikeshedding. But what do you think of changing the name of fromRaster to rasterDia?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably and improvement.

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.

None yet

2 participants