GithubHelp home page GithubHelp logo

Comments (10)

andrewbaxter avatar andrewbaxter commented on May 14, 2024

Not sure if it helps but this compiles in Java 9:

byte[] pixels = ((DataBufferByte) bufferedImage.getRaster().getDataBuffer()).getData();a

(http://stackoverflow.com/questions/6524196/java-get-pixel-array-from-image)

and

bufferedImage.getRaster().getNumBands();
((ComponentSampleModel)bufferedImage.getRaster().getSampleModel()).getScanlineStride();

etc

from boofcv.

andrewbaxter avatar andrewbaxter commented on May 14, 2024

Actually, now I can't compile due to references to missing classes

ByteInterleavedRaster
IntegerInterleavedRaster
ShortInterleavedRaster
SunWritableRaster

I made shims and switched to the slow converters and everything's working for the moment.

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

I really hope they didn't remove those classes....

Is the open jdk or oracle jdk? There are some differences in internal classes.

from boofcv.

andrewbaxter avatar andrewbaxter commented on May 14, 2024

Oracle JDK 9b158-1. I don't see them around in this clone at least: https://github.com/netroby/jdk9-dev/tree/1f1e32c62957fac471fd49c4d597706cba281e6f/jdk/src/java.desktop/share/classes/java/awt/image

from boofcv.

andrewbaxter avatar andrewbaxter commented on May 14, 2024

Oh, they still seems to be here: https://github.com/netroby/jdk9-dev/tree/1f1e32c62957fac471fd49c4d597706cba281e6f/jdk/src/java.desktop/share/classes/sun/awt/image

from boofcv.

andrewbaxter avatar andrewbaxter commented on May 14, 2024

It's possible there's a jvm command line override to access the package: http://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

Still not ideal, but looking at your second comment I think there might be a workaround. Worst case scenario I'll have to create an implementation specific for JDK 9.

The reason these hacks are there is because BufferedImage is poorly designed from an efficiency perspective. As long as I can get access to the raw array and know the format it's encoded in this should be fast.

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

Looked into this issue some more. Figured out how to still get access to the raw data. Unfortunate I have yet to figure out to get the data offset value. This means support for subimages will most likely be removed.

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

I'm attempting to convince the developers of java 9 to change the api. Sounds like I missed the boat for the first release but maybe in a future update.

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

Removed all references to internal sun raster classes. Should run in Java 9. Won't work with subimages in java 9

from boofcv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.