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

Image2D, Image3D: methods only available with ByteBuffers, Pointers also needed #27

Open
royerloic opened this issue May 7, 2015 · 0 comments

Comments

@royerloic
Copy link

Dear Olivier,

In the context of our work: https://clearvolume.github.io/ClearVolume/
We encounter the following issue: ByteBuffers are limited in size and
so when we upload 3D images of more that a few gigabytes (yes we do that!)
we run into trouble. Right now I use reflection to circumvent this and somehow
acess some private methods and fields. VERY DIRTY.
We use BridJ and an Unsafe based infrastructure to get
data from our microscopes. It would be great to expose the Pointer based function
calls so that users have the choice between ByteBuffers or Pointers.

Below is an example of the kind of helper functions I have to circumvent this problem:

public static CLEvent readImage3D(CLImage pCLImage,
                                  CLQueue pCLQueue,
                                  Pointer<?> pPointer,
                                  long pX,
                                  long pY,
                                  long pZ,
                                  long pWidth,
                                  long pHeight,
                                  long pDepth,
                                  boolean pBlocking)
  {
    try
    {
      return (CLEvent) JavaCLUtils.sReadMethod.invoke(pCLImage,
                                      pCLQueue,
                                      pointerToSizeTs(pX, pY, pZ),
                                      pointerToSizeTs(pWidth,
                                                      pHeight,
                                                      pDepth),
                                      0L,
                                      0L,
                                      pPointer,
                                      pBlocking,
                                      new CLEvent[0]);
    }
    catch (final Throwable e)
    {
      e.printStackTrace();
    }
    return null;
  }
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