本文整理汇总了C++中imageStruct::fromRGBA方法的典型用法代码示例。如果您正苦于以下问题:C++ imageStruct::fromRGBA方法的具体用法?C++ imageStruct::fromRGBA怎么用?C++ imageStruct::fromRGBA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imageStruct
的用法示例。
在下文中一共展示了imageStruct::fromRGBA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processGrayImage
void pix_colorreduce :: processGrayImage(imageStruct &image)
{
tempImage.xsize=image.xsize;
tempImage.ysize=image.ysize;
tempImage.fromGray(image.data);
processRGBAImage(tempImage);
image.fromRGBA(tempImage.data);
}
示例2: processImage
/////////////////////////////////////////////////////////
// processImage
//
/////////////////////////////////////////////////////////
void pix_freeframe :: processImage(imageStruct &image)
{
unsigned int format=m_image.format;
unsigned char*data=image.data;
if(m_plugin==NULL)return;
// convert the current image into a format that suits the FreeFrame-plugin
if(image.format!=format){
switch (image.format){
case GL_RGBA:
m_image.fromRGBA(image.data);
break;
case GL_BGRA_EXT: /* "RGBA" on apple */
m_image.fromBGRA(image.data);
break;
case GL_LUMINANCE: // greyscale
m_image.fromGray(image.data);
break;
case GL_YUV422_GEM: // YUV
m_image.fromYUV422(image.data);
break;
}
m_plugin->processFrame(m_image);
data=m_image.data;
} else {
m_plugin->processFrame(image);
data=image.data;
}
// check whether we have converted our image data
if(image.data!=data)
// it seems, like we did: convert it back
// just copied the code from [pix_rgba]
switch(format) {
case GL_RGBA:
image.fromRGBA(m_image.data);
break;
case GL_RGB:
image.fromRGB(m_image.data);
break;
case GL_BGR_EXT:
image.fromBGR(m_image.data);
break;
case GL_BGRA_EXT: /* "RGBA" on apple */
image.fromBGRA(m_image.data);
break;
case GL_LUMINANCE:
image.fromGray(m_image.data);
break;
case GL_YCBCR_422_GEM: // YUV
image.fromUYVY(m_image.data);
break;
default:
error("no method for this format !!!");
error("if you know how to convert this format (%X),\n"
"please contact the authors of this software", image.format);
return;
}
}