Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > DirectByteBuffer and BufferedImage for image acquisition

Reply
Thread Tools

DirectByteBuffer and BufferedImage for image acquisition

 
 
Peter Szymanski
Guest
Posts: n/a
 
      07-09-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems using DirectByteBuffer cornerback Java 0 08-28-2009 11:21 AM
Digital Camera Image Acquisition Database Will Digital Photography 0 02-01-2007 07:01 AM
DCOM and Windows Image Acquisition Franklin Computer Security 2 11-09-2004 02:09 AM
DOC and Windows Image Acquisition Franklin Computer Security 0 11-08-2004 11:31 PM
Windows Image Acquisition Tools Who's Harry Computer Support 0 12-18-2003 01:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57