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

Comply with image.Image interface #8

Open
ismasan opened this issue Feb 10, 2014 · 1 comment
Open

Comply with image.Image interface #8

ismasan opened this issue Feb 10, 2014 · 1 comment

Comments

@ismasan
Copy link

ismasan commented Feb 10, 2014

This is more of a question than an issue: I wonder how hard it would be to make MagickImage comply with the image.Image interface in the image stdlib package?

The use case would be that I can use magick along with other image-handling packages. For example I just wrote an image resizing server using Resize and I would like to replace the image-handling parts of my code with magick so I can benchmark the two.

Looking at the image.Image interface definition it looks like you'd only have to implement the following:

type Image interface {
        // ColorModel returns the Image's color model.
        ColorModel() color.Model
        // Bounds returns the domain for which At can return non-zero color.
        // The bounds do not necessarily contain the point (0, 0).
        Bounds() Rectangle
        // At returns the color of the pixel at (x, y).
        // At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid.
        // At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
        At(x, y int) color.Color
}
@xinuc
Copy link

xinuc commented Sep 22, 2015

👍 for this

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

No branches or pull requests

2 participants