-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Convert Picture
to BufferedImage
#87
Comments
Hi Noel, |
That's not really the issue. This is about having a way to convert the |
I have one question about the end result. After the succesful implementation we want to be able to do something like: val picture = circle(100)
val bi = picture.fromPicture where bi is a val picture = circle(100)
val (res, bi) = picture.fromPicture Another possibility is to have a method |
The closest equivalent is the Base64 effect. I think the following is probably what is needed:
def bufferedImage[A](picture: Picture[Alg, A]): IO[(A, BufferedImage)]
|
Yes, I think you're right. The parameters to def bufferedImage[A](frame: Frame, picture: Picture[Alg, A]): IO[(A, BufferedImage)] The different order of types is just an accident. The external APIs should be as consistent as possible, and hence should follow the precedent in |
Does the binary compatibillity check failing mean that I cannot make the |
You can ignore binary compatibility issues. If you bump the base version defined in |
I made everything specific for java2d backend but now I started thinking that maybe the approach of making the converter generic with respect to the bitmap is better as other backends might have their own bitmap classes and that could be helpful for example if we want draw pixels on the screen or do the convolutions (#94) |
Agreed with this. To avoid scope creep I opened another issue (#145) that includes this. |
Create a stable Java2D specific method to convert a
Picture
to aBufferedImage
. This will allow fun pixel art in conjunction with #85. This should be a new kind of effect type class, I think.We already have a
ToPicture
type class. PerhapsFromPicture
is the natural counterpart here? Not sure they would be symmetric though---rendering a picture is an effect but converting to a picture is not.The text was updated successfully, but these errors were encountered: