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
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