Skip to content

Commit

Permalink
ofxOpenNIUtils: added of<->xn conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoc committed Oct 13, 2011
1 parent 0603a40 commit 40a9020
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ofxOpenNIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <XnCppWrapper.h>
#include <XnTypes.h>
#include "ofConstants.h"
#include "ofxOpenNIUtils.h"

#define YUV422_U 0
#define YUV422_Y1 1
Expand Down
13 changes: 13 additions & 0 deletions src/ofxOpenNIUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@
#ifndef OFXOPENNIUTILS_H_
#define OFXOPENNIUTILS_H_

#include <XnTypes.h>
#include "ofPoint.h"

void YUV422ToRGB888(const XnUInt8* pYUVImage, XnUInt8* pRGBImage, XnUInt32 nYUVSize, XnUInt32 nRGBSize);

#define SHOW_RC(rc, what) \
ofLogNotice(LOG_NAME) << what << "status:" << xnGetStatusString(rc);

inline ofPoint toOf(const XnPoint3D & p){
return ofPoint(p.X,p.Y,p.Z);
}

inline XnPoint3D toXn(const ofPoint & p){
XnPoint3D r;
r.X = p.x;
r.Y = p.y;
r.Z = p.z;
return r;
}
#endif /* OFXOPENNIUTILS_H_ */

0 comments on commit 40a9020

Please sign in to comment.