コード例 #1
0
ファイル: ofTexture.cpp プロジェクト: Akzwar/Projects_backup
//---------------------------------
int ofGetGlInternalFormat(const ofShortPixels& pix) {
#ifndef TARGET_OPENGLES
	switch(pix.getNumChannels()) {
		case 3: return GL_RGB16;
		case 4: return GL_RGBA16;
		default: return GL_LUMINANCE16;
	}
#else
	ofLogWarning()<< "16bit textures not supported in GLES";
	switch(pix.getNumChannels()) {
		case 3: return GL_RGB;
		case 4: return GL_RGBA;
		default: return GL_LUMINANCE;
	}
#endif
}
コード例 #2
0
ファイル: ofTexture.cpp プロジェクト: jvcleave/compare
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix, int glFormat){
	if(!isAllocated()){
		allocate(pix.getWidth(), pix.getHeight(), ofGetGlInternalFormat(pix), ofGetUsingArbTex(), glFormat, ofGetGlType(pix));
	}
	ofSetPixelStoreiAlignment(GL_UNPACK_ALIGNMENT,pix.getWidth(),pix.getBytesPerChannel(),ofGetNumChannelsFromGLFormat(glFormat));
	loadData(pix.getData(), pix.getWidth(), pix.getHeight(), glFormat, ofGetGlType(pix));
}
コード例 #3
0
FREE_IMAGE_TYPE getFreeImageType(const ofShortPixels& pix) {
	switch(pix.getNumChannels()) {
		case 1: return FIT_UINT16;
		case 3: return FIT_RGB16;
		case 4: return FIT_RGBA16;
		default:
			ofLogError("ofImage") << "getFreeImageType(): unknown FreeImage type for number of channels:" << pix.getNumChannels();
			return FIT_UNKNOWN;
	}
}
コード例 #4
0
void ofFbo::readToPixels(ofShortPixels & pixels, int attachmentPoint){
#ifndef TARGET_OPENGLES
	getTextureReference(attachmentPoint).readToPixels(pixels);
#else
	bind();
	int format,type;
	ofGetGlFormatAndType(settings.internalformat,format,type);
	glReadPixels(0,0,settings.width, settings.height, format, GL_UNSIGNED_SHORT, pixels.getPixels());
	unbind();
#endif
}
void ofxDepthImageCompressor::convertTo8BitImage(ofShortPixels& pix, ofImage& image){
	convertTo8BitImage(pix.getPixels(), image);
}
ofImage ofxDepthImageCompressor::convertTo8BitImage(ofShortPixels& pix, bool createTexture){
	return convertTo8BitImage(pix.getPixels(), createTexture);
}
void ofxDepthImageCompressor::readCompressedPng(string filename, ofShortPixels& pix){
	if(!pix.isAllocated()){
		pix.allocate(640, 480, 1);
	}
	readCompressedPng(filename, pix.getPixels());
}
コード例 #8
0
void ofxTexture3d::loadData(ofShortPixels & pix, int d, int xOffset, int yOffset, int zOffset)
{
    loadData(pix.getData(), pix.getWidth(), pix.getHeight(), d, xOffset, yOffset, zOffset, ofGetGlFormat(pix));
}
コード例 #9
0
//----------------------------------------------------------
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));
}
コード例 #10
0
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix){
	ofSetPixelStorei(pix.getBytesStride());
	loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix), ofGetGlType(pix));
}
コード例 #11
0
//----------------------------------------------------------
void ofTexture::allocate(const ofShortPixels& pix, bool bUseARBExtention){
	allocate(pix.getWidth(), pix.getHeight(), ofGetGlInternalFormat(pix), bUseARBExtention, ofGetGlFormat(pix), ofGetGlType(pix));
}
コード例 #12
0
//----------------------------------------------------------
void ofTexture::allocate(const ofShortPixels& pix){
	allocate(pix.getWidth(), pix.getHeight(), ofGetGlInternalFormat(pix), ofGetUsingArbTex(), ofGetGlFormat(pix), ofGetGlType(pix));
}
コード例 #13
0
bool ofxDepthImageRecorder::addImage(ofShortPixels& image){
	return addImage(image.getPixels());
}
コード例 #14
0
ファイル: ofTexture.cpp プロジェクト: 3snail/openFrameworks
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix){
	loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix));
}
コード例 #15
0
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix, int glFormat){
	ofSetPixelStoreiAlignment(GL_UNPACK_ALIGNMENT,pix.getWidth(),pix.getBytesPerChannel(),ofGetNumChannelsFromGLFormat(glFormat));
	loadData(pix.getData(), pix.getWidth(), pix.getHeight(), glFormat, ofGetGlType(pix));
}
コード例 #16
0
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix){
	ofSetPixelStoreiAlignment(GL_UNPACK_ALIGNMENT,pix.getBytesStride());
	loadData(pix.getData(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix), ofGetGlType(pix));
}