Have a very basic question. I have a kinect video feed as an unsigned char* . How do I convert that to ofTexture* ?
I’ve tried typecasting and it doesn’t work: (ofTexture&)outputKinectFrame. Basically I need to replace the webcam feed (cam.getTextureReference()) with kinect.
the typical use is like this:
texture.allocate(yourImageWidth, yourImageHeight, GL_RGBA);
usigned char * data is usually pixels so you can do this:
unsigned char* yourData;
However the kinect is a bit different depending on what your data is as it can be from the video feed, depth feed or the IR feed. Each one of these has a different color format that you have to deal with.
You can take a look at ofxKinect and see how it deals with it internally
This file has been truncated.
Copyright (c) 2010, 2011 ofxKinect Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Thanks so much for the quick reply. How do I then convert ofTexture to ofTexture* ? Because I need a reference to pass to my shader.
ofTexture* texturePointer = &texture;
That worked. Thank you! Really appreciate it.