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

Decode Images Without ByteBuffers #5

Closed
wants to merge 7 commits into from
Closed

Decode Images Without ByteBuffers #5

wants to merge 7 commits into from

Conversation

jballanc
Copy link
Contributor

@jballanc jballanc commented Nov 2, 2016

The goal of this branch/PR is to figure out how to avoid having to create direct allocated ByteBuffer objects (which don't play nice with the JVM's GC) in order to get JXR-encoded data to the underlying C++ library or the decoded pixels back to JVM-land.

This skips one-half of the `ByteBuffer` dance that we currently have to
do to get JXR data to C++ and the decoded image bytes back to Java.
Currently, this requires manual edits to the SWIG generated Java and C++
files, so this commit also checks these in. As soon as we can re-write
the SWIG interface file, we should be able to re-exclude these files.
This method is what the Java wrapper will call in order to return a
`byte[]` for the decoded image directly (i.e. without the need for a
pre-allocated `ByteStream`).
This is just a simple little change that allows for the
testing/validation of returning a `vector<unsigned char>` directly upon
decoding an image.
This moves the existing decode assertion utilizing a `ByteBuffer` to
`assertBufferDecode` and adds a new `assertByteArrayDecode` method that
utilizes the method of directly returning a `byte[]` from image decoding.
@melissalinkert
Copy link
Member

Closing as discussed in the context of upcoming work on #32.

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

Successfully merging this pull request may close these issues.

2 participants