本文整理汇总了C++中ofShortPixels类的典型用法代码示例。如果您正苦于以下问题:C++ ofShortPixels类的具体用法?C++ ofShortPixels怎么用?C++ ofShortPixels使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ofShortPixels类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ofGetGlInternalFormat
//---------------------------------
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: loadData
//----------------------------------------------------------
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: getFreeImageType
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:
void ofxDepthImageCompressor::convertTo8BitImage(ofShortPixels& pix, ofImage& image){
convertTo8BitImage(pix.getPixels(), image);
}
示例5: readCompressedPng
void ofxDepthImageCompressor::readCompressedPng(string filename, ofShortPixels& pix){
if(!pix.isAllocated()){
pix.allocate(640, 480, 1);
}
readCompressedPng(filename, pix.getPixels());
}
示例6: loadData
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));
}
示例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));
}
示例8: allocate
//----------------------------------------------------------
void ofTexture::allocate(const ofShortPixels& pix, bool bUseARBExtention){
allocate(pix.getWidth(), pix.getHeight(), ofGetGlInternalFormat(pix), bUseARBExtention, ofGetGlFormat(pix), ofGetGlType(pix));
}
示例9: addImage
bool ofxDepthImageRecorder::addImage(ofShortPixels& image){
return addImage(image.getPixels());
}
示例10: loadData
//----------------------------------------------------------
void ofTexture::loadData(const ofShortPixels & pix){
loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix));
}
示例11: loadData
//----------------------------------------------------------
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));
}