Exemplo n.º 1
0
void Film::generateImgVector(vector<unsigned char> & image)
{
	int length = width * height * 4;

	int r, c;
	int i;
	for ( r = 0 ; r < height; r ++)
	{
		for (c = 0; c < width; c++)
		{
			i = r * width * 4 + c * 4;


			Color cur_color(getColorAt(r,c));

			image.at(i) = colorFloat2Byte(cur_color(0));		//r
			image.at(i+1) = colorFloat2Byte(cur_color(1));		//g
			image.at(i+2) = colorFloat2Byte(cur_color(2));		//b
			image.at(i+3) = 255;								//a
		}
	}
}
//------------------------------------
ofColor ofxKinect::getCalibratedColorAt(int x, int y){
	ofxVec3f texcoord3d;
	texcoord3d.set(x,y,0);
	texcoord3d = rgbDepthMatrix * texcoord3d;
	return getColorAt(ofClamp(texcoord3d.x,0,640),ofClamp(texcoord3d.y,0,480));
}
//------------------------------------
ofColor ofxKinect::getColorAt(const ofPoint & p) {
	return getColorAt(p.x, p.y);
}
Exemplo n.º 4
0
//------------------------------------
ofColor ofxKinect::getCalibratedColorAt(int x, int y) {
    return getColorAt(calibration.getCalibratedColorCoordAt(x,y));
}
Exemplo n.º 5
0
//------------------------------------
ofColor ofxKinect::getCalibratedColorAt(const ofPoint & p){
	return getColorAt(calibration.getCalibratedColorCoordAt(p));
}
Exemplo n.º 6
0
//------------------------------------
ofColor ofxRSSDK::getColorAt(const ofPoint & p) {
	return getColorAt(p.x, p.y);
}