当前位置: 首页>>代码示例>>C++>>正文


C++ ofShortPixels::getPixels方法代码示例

本文整理汇总了C++中ofShortPixels::getPixels方法的典型用法代码示例。如果您正苦于以下问题:C++ ofShortPixels::getPixels方法的具体用法?C++ ofShortPixels::getPixels怎么用?C++ ofShortPixels::getPixels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ofShortPixels的用法示例。


在下文中一共展示了ofShortPixels::getPixels方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateDepthImage

void ofxRGBDCaptureGui::updateDepthImage(ofShortPixels& pixels){
    
    if(!pixels.isAllocated()){
        return;
    }
    
    int max_depth = depthImageProvider->maxDepth();    
    if(max_depth == 0){
    	max_depth = 5000;
    }
//    cout << "updating depth image with max depth of " << max_depth << " render: " << (currentRenderMode == RenderRainbow ? "rainbow" : "b&w") <<  endl;
    if(currentRenderMode == RenderRainbow){
        for(int i = 0; i < 640*480; i++){
            int lookup = pixels.getPixels()[i] / (max_depth / 256);
            //int lookup = ofMap( depthPixels.getPixels()[i], 0, max_depth, 0, 255, true);
            depthImage.getPixels()[(i*3)+0] = LUTR[lookup];
            depthImage.getPixels()[(i*3)+1] = LUTG[lookup];
            depthImage.getPixels()[(i*3)+2] = LUTB[lookup];
        }
    }
    else{
        recorder.compressorRef().convertTo8BitImage(pixels, depthImage);
    }
    
    depthImage.update();
	
}
开发者ID:buenoIsHere,项目名称:ofxRGBDepth,代码行数:27,代码来源:ofxRGBDCaptureGui.cpp

示例2: drawPointcloud

void ofxRGBDCaptureGui::drawPointcloud(ofShortPixels& pix, bool fullscreen){

	glEnable(GL_DEPTH_TEST);
	ofMesh mesh;
	ofRectangle rect = fullscreen ? ofRectangle(0,0, ofGetWidth(), ofGetHeight()) : previewRect;
    //glEnable(GL_POINT_SMOOTH);
    //glEnable(GL_VERTEX_PROGRAM_POINT_SIZE_ARB);	// allows per-point size
    glPointSize(2);
	for(int y = 0; y < 480; y++){
		for(int x = 0; x < 640; x++){
			//0.104200 ref dist 120.000000
			double ref_pix_size = 0.104200;
			double ref_distance = 120.000000;
			double wz = pix.getPixels()[y*640+x];
			double factor = 2 * ref_pix_size * wz / ref_distance;
			double wx = (double)(x - 640/2) * factor;
			double wy = (double)(y - 480/2) * factor;
            mesh.addVertex(ofVec3f(wx,-wy,-wz));
		}
	}
    
    cam.begin(rect);
	mesh.drawVertices();
	cam.end();
    
	glDisable(GL_DEPTH_TEST);	
}
开发者ID:buenoIsHere,项目名称:ofxRGBDepth,代码行数:27,代码来源:ofxRGBDCaptureGui.cpp

示例3: readToPixels

//----------------------------------------------------------
void ofTexture::readToPixels(ofShortPixels & pixels){
#ifndef TARGET_OPENGLES
	pixels.allocate(texData.width,texData.height,ofGetImageTypeFromGLType(texData.glTypeInternal));
	bind();
	glGetTexImage(texData.textureTarget,0,ofGetGlFormat(pixels),GL_UNSIGNED_SHORT,pixels.getPixels());
	unbind();
#endif
}
开发者ID:Robertoq7,项目名称:openFrameworks,代码行数:9,代码来源:ofTexture.cpp

示例4: readToPixels

void ofFbo::readToPixels(ofShortPixels & pixels, int attachmentPoint){
	if(!bIsAllocated) return;
#ifndef TARGET_OPENGLES
	getTextureReference(attachmentPoint).readToPixels(pixels);
#else
	pixels.allocate(settings.width,settings.height,ofGetImageTypeFromGLType(settings.internalformat));
	bind();
	int format = ofGetGLFormatFromInternal(settings.internalformat);
	glReadPixels(0,0,settings.width, settings.height, format, GL_UNSIGNED_SHORT, pixels.getPixels());
	unbind();
#endif
}
开发者ID:FlavioFalcao,项目名称:openFrameworks,代码行数:12,代码来源:ofFbo.cpp

示例5:

void ofxDepthImageCompressor::convertTo8BitImage(ofShortPixels& pix, ofImage& image){
	convertTo8BitImage(pix.getPixels(), image);
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:ofxRGBDepth,代码行数:3,代码来源:ofxDepthImageCompressor.cpp

示例6: readCompressedPng

void ofxDepthImageCompressor::readCompressedPng(string filename, ofShortPixels& pix){
	if(!pix.isAllocated()){
		pix.allocate(640, 480, 1);
	}
	readCompressedPng(filename, pix.getPixels());
}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:ofxRGBDepth,代码行数:6,代码来源:ofxDepthImageCompressor.cpp

示例7: loadData

//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix, int glFormat){
	ofSetPixelStorei(pix.getWidth(),pix.getBytesPerChannel(),ofGetNumChannelsFromGLFormat(glFormat));
	loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), glFormat, ofGetGlType(pix));
}
开发者ID:Robertoq7,项目名称:openFrameworks,代码行数:5,代码来源:ofTexture.cpp

示例8: addImage

bool ofxDepthImageRecorder::addImage(ofShortPixels& image){
	return addImage(image.getPixels());
}
开发者ID:usm916,项目名称:ofxRGBDepth,代码行数:3,代码来源:ofxDepthImageRecorder.cpp

示例9: loadData

//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix){
	loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix));
}
开发者ID:3snail,项目名称:openFrameworks,代码行数:4,代码来源:ofTexture.cpp


注:本文中的ofShortPixels::getPixels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。