YUVFormat displays as all black

J

jeff.bethune

Hey guys,

I've been banging my head against the wall for sometime now, and
thought there might be someone out there who knows what I'm doing
wrong. I have a byte array with 1024*768 data stored in UYVY format
and I want to get that into an image object to display properly. The
image object is created fine, but the image turns out all black (and
the image isn't all black). Here's the code in question:

Buffer buf = new Buffer();
byte[] array = triggerAndReturnImage();
YUVFormat yuv = new YUVFormat(new java.awt.Dimension(1024,768) ,
Format.NOT_SPECIFIED, YUVFormat.byteArray,
15.00002f,YUVFormat.YUV_422,2,4,1,0,2);
buf.setFormat(yuv);
buf.setData(array);
BufferToImage buf2Image = new BufferToImage(yuv);
Image newImage = buf2Image.createImage(buf);

triggerAndReturnImage() is a JNI function that I've created that passes
back a byte array snapped from the SDK given from Sony's DFW-X710
camera. I'm sure that the bytes that are coming back are fine.

Thank you,
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top