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

Is it possible to use color.Model when rasterizing? #68

Open
akiross opened this issue Oct 28, 2018 · 0 comments
Open

Is it possible to use color.Model when rasterizing? #68

akiross opened this issue Oct 28, 2018 · 0 comments

Comments

@akiross
Copy link

akiross commented Oct 28, 2018

Hello,
this is kinda of a feature request, but also a request for clarification because maybe I just got things wrong.
I am trying to work on go-sdl2 so that SDL Surfaces implements go's image.Image and image/draw.Image interfaces. The idea is to be able to render directly on SDL surfaces. After making such changes and trying to use freetype raster's on that surfaces, I noticed that there are a certain number of painters, each of which is working with a specific image format.

Now, I find this confusing: isn't image/color.Model there to perform color conversion from one model to another? So, my question boils down to: why isn't there a painter which can deal with a generic image/draw.Image and use its color model to map the pixels produced by rasterizer to whatever color format the image is using? Is this feasible at all or did I get all wrong?

I thought that, given a certain color you wanted to draw on the image, one could just do img.Set(img.ColorModel().Convert(your_color)). Is a painter like this possible to have?

Thanks!

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

1 participant