Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ofxOpenNITypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,14 @@ class ofxOpenNIUser {

//return *this;
}


vector<ofxOpenNIJoint> joints; // harlequin hack
private:

friend class ofxOpenNI; // so we can access directly in ofxOpenNI

ofPoint center;
vector<ofxOpenNIJoint> joints;
// vector<ofxOpenNIJoint> joints; // harlequin hack
vector<ofxOpenNILimb> limbs;
ofMesh pointCloud[2];
ofMesh* backPointCloud;
Expand Down
31 changes: 31 additions & 0 deletions src/ofxOpenNIUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ enum DepthColoring {
COLORING_RAINBOW,
COLORING_CYCLIC_RAINBOW,
COLORING_BLUES,
COLORING_BLUES_INV,
COLORING_GREY,
COLORING_STATUS,
COLORING_COUNT
Expand Down Expand Up @@ -442,6 +443,36 @@ inline void getDepthColor(DepthColoring depthColoring, const unsigned short & de
color.r = 255;
}
break;
case COLORING_BLUES_INV:
// 3 bytes of depth: white (111) << cyan (011) <<c olor.b (001) << black (R0G0B0)
max = 256+255+255;
col_index = (XnUInt16)(((depth) / (maxDepth / max)));
if ( col_index < 256 )
{
color.b = 255;
color.g = 255;
color.r = 255 - col_index;
}
else if ( col_index < (256+255) )
{
color.b = 255;
color.g = 255 - (col_index % 256) + 1;
color.r = 0;
}
else if ( col_index < (256+255+255) )
{
color.b = 255 - (col_index % 256) + 1;
color.g = 0;
color.r = 0;
}
else
{
color.b = 0;
color.g = 0;
color.r = 0;
}
break;

case COLORING_GREY:
max = 255; // half depth
{
Expand Down