Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
DirectByteBuffer and BufferedImage for image acquisition
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Peter Szymanski, post: 529924"] Hi there, I am trying to get acquired images into a java application for analysis from a 2000x1500 pixel 12 bit camera. I am currently copying from the camera framebuffer into malloc memory in a JNI compiled dll. At the moment <c file> JNIEXPORT jobject JNICALL Java_CameraEpixJNI_doNativeMapBuffer (JNIEnv *env, jobject obj, jint cardNum, jint bufNum){ ... pxd_readuchar(1, 1, x1, y1, x2, y2, membuf, (long)capacity,"Grey");//library function to copy pixels into membuffer(membuffer malloced earlier) return (*env)->NewDirectByteBuffer(env, membuf, capacity); .... } </c> currently in java, whenever the application needs the BufferedImage, I use the 'bulk get' ByteBuffer.get(byte[] into, offset, length) method, where the into[] array has been used to create the member BufferedImage variable in the constructor of the camera class. My question is, is it possible to wrap a BufferedImage directly around the DirectByteBuffer, where if the dll is called to change the buffer in native code, will the BufferedImage reflect the change? Is there a better way? Thanks in advance, Peter [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
DirectByteBuffer and BufferedImage for image acquisition
Top