Java Code Examples for processing.opengl.Texture#copyBufferFromSource()
The following examples show how to use
processing.opengl.Texture#copyBufferFromSource() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CamImageColor.java From PapARt with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void update(IplImage iplImage) { Texture tex = ((PGraphicsOpenGL) parent.g).getTexture(this); ByteBuffer imageBuffer = iplImage.getByteBuffer(); if (this.incomingFormat == Camera.PixelFormat.BGR) { ImageUtils.byteBufferBRGtoARGB(imageBuffer, argbBuffer); } if (this.incomingFormat == Camera.PixelFormat.RGB) { ImageUtils.byteBufferRGBtoARGB(imageBuffer, argbBuffer); } if (this.incomingFormat == Camera.PixelFormat.ARGB) { argbBuffer = iplImage.getByteBuffer(); } tex.copyBufferFromSource(null, argbBuffer, width, height); argbBuffer.rewind(); }
Example 2
Source File: CamImageGray.java From PapARt with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void update(opencv_core.IplImage iplImage) { Texture tex = ((PGraphicsOpenGL) parent.g).getTexture(this); ByteBuffer imageBuffer = iplImage.getByteBuffer(); if (incomingFormat == PixelFormat.GRAY) { ImageUtils.byteBufferGRAYtoARGB(imageBuffer, argbBuffer); } if (incomingFormat == PixelFormat.GRAY_32) { ImageUtils.byteBufferGRAY32toARGB(imageBuffer, argbBuffer); } if (incomingFormat == PixelFormat.FLOAT_DEPTH_KINECT2) { ImageUtils.byteBufferDepthK2toARGB(imageBuffer, argbBuffer); } if (incomingFormat == PixelFormat.DEPTH_KINECT_MM) { ImageUtils.byteBufferDepthK1MMtoARGB(imageBuffer, argbBuffer); } if (incomingFormat == PixelFormat.REALSENSE_Z16) { ImageUtils.byteBufferZ16toARGB(imageBuffer, argbBuffer); } if (incomingFormat == PixelFormat.OPENNI_2_DEPTH) { ImageUtils.byteBufferShorttoARGB(imageBuffer, argbBuffer); } // Utils.byteBufferBRGtoARGB(bgrBuffer, argbBuffer); tex.copyBufferFromSource(null, argbBuffer, width, height); imageBuffer.rewind(); }