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

Move `loadImage()` into `Surface`, and AWT out of `PImage` #56

Open
benfry opened this issue Jan 19, 2020 · 4 comments
Open

Move `loadImage()` into `Surface`, and AWT out of `PImage` #56

benfry opened this issue Jan 19, 2020 · 4 comments

Comments

@benfry
Copy link
Member

@benfry benfry commented Jan 19, 2020

Several changes necessary to move image handling into Surface so that we're not invoking AWT.

However, if that's done, we need to replace the image loading for JOGL and JavaFX as well, or have those subclass a LameKindaSurfaceAWT which has the AWT code.

There's a constructor, resizer, and some IO options in PImage that all make use of AWT code. These will all be moved to PImageJava2D inside the processing.awt package, but will need replacements for JOGL and JavaFX.

@neilcsmith-net
Copy link

@neilcsmith-net neilcsmith-net commented Jan 20, 2020

Are you trying to remove all AWT usage or just allow headless (for eg. LWJGL use)? Because large portion of Processing AWT code, such as in PImage, PFont, etc. works fine headless.

@sampottinger
Copy link
Collaborator

@sampottinger sampottinger commented Apr 16, 2020

Yeah I agree with @neilcsmith-net. There's some stuff like image saving where it's headless-OK but where AWT-dependent code has become standard. For example, it looks like even in JavaFX and JOGL, BufferedImage is still the canonical solution. There might not be a way to avoid using it.

@neilcsmith-net
Copy link

@neilcsmith-net neilcsmith-net commented Aug 17, 2020

As per @sampottinger comment, LWJGL might be better placed in terms of library integration to allow a complete removal of AWT / java.desktop dependencies for a particular renderer. @benfry interesting page, but surprised to see LWJGL still under discussion - thought that had been dropped? My issue to discuss necessary changes to PApplet to support it were closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.