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

Add Native images to Diagrams.TwoD.Image #199

Merged
merged 2 commits into from Jun 23, 2014
Merged

Conversation

taruti
Copy link
Contributor

@taruti taruti commented Jun 22, 2014

Add a type for "Native" images that can be hooked by other packages.

This makes it possible to write libraries like:
https://taruti.github.io/diagrams-cairo-raster/

The issue with using "Embedded" images is that they are typically not in the pixel format that the backend likes. When using images as tiles (the same image is rendered many times) doing a costly conversion step on each "render" is not feasible.

This minimal support for "Native" images makes it possible to write high-performance native backend specific raster image functionality.

@@ -49,12 +49,14 @@ import Data.Semigroup

data Embedded deriving Typeable
data External deriving Typeable
data Native (t :: *) deriving Typeable

-- | 'ImageData' is either a JuicyPixels @DynamicImage@ tagged as 'Embedded' or
-- a reference tagged as 'External'.
Copy link
Member

Choose a reason for hiding this comment

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

This comment should be updated as well.

byorgey added a commit that referenced this pull request Jun 23, 2014
Add Native images to Diagrams.TwoD.Image
@byorgey byorgey merged commit 32fa6ec into diagrams:master Jun 23, 2014
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