获取色彩深度问题

Mack_liu 2020-01-17 03:33:07
本人最近调试飞凌开发板的显示问题,有问题请教一下:
平台:iMX6DL
内核:3.0.35
在fbmem.c文件中fb_prepare_logo函数中,函数开始获取色深
int fb_prepare_logo(struct fb_info *info, int rotate)
{
//获取当前图片的色深
int depth = fb_get_color_depth(&info->var, &info->fix);
unsigned int yres;
//初始化fb_logo
memset(&fb_logo, 0, sizeof(struct logo_data));
//-------?--start
if (info->flags & FBINFO_MISC_TILEBLITTING ||
info->flags & FBINFO_MODULE)
return 0;

if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
depth = info->var.blue.length;
if (info->var.red.length < depth)
depth = info->var.red.length;
if (info->var.green.length < depth)
depth = info->var.green.length;
}
//-------?--end
if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
/* assume console colormap */
depth = 4;
}

/* Return if no suitable logo was found */
fb_logo.logo = fb_find_logo(depth);

上面这部分代码中
int depth = fb_get_color_depth(&info->var, &info->fix);
已经获取了色深在线面为什么还要
        if (info->flags & FBINFO_MISC_TILEBLITTING ||
info->flags & FBINFO_MODULE)
return 0;

if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
depth = info->var.blue.length;
if (info->var.red.length < depth)
depth = info->var.red.length;
if (info->var.green.length < depth)
depth = info->var.green.length;
}
//-------?--end
if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) {
/* assume console colormap */
depth = 4;
}

有懂显示的大牛,麻烦解答一下
...全文
79 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
网上有不少使用Qt做界面,OpenNI为库来开发kinect。或许大家的第一个问题就是询问该怎样使用Kinect来获取颜色信息图和深度信息图呢?这一节就是简单来回答这个问题的。 使用OpenNI读取颜色图和深度图的步骤如下(这个是程序的核心部分):   1. 定义一个Context对象,并 调用该对象的Init()方法来进行初始化。   2. 定义一个XnMapOutputMode格式对象,设置好分图像分辨率和帧率。   3. 定义颜色图和深度图的节点对象,并用其Create()方法来创建,参数为Context对象.   4. 设置颜色和深度图的输出模式,调用的方法是SetMapOutputMode();参数为步骤2中定义和设置好了的XnMapOutputMode对象。   6. 如果深度图和颜色图在一张图上显示,则必须对深度图像进行校正,校正的方法是调用深度图的如下方法:.GetAlternativeViewPointCap().SetViewPoint();   7. 调用context对象的StartGeneratingAll()来开启设备读取数据开关。   8. 调用context对象的更新数据方法,比如WaitAndupdateAll()方法。   9. 定义颜色图和色彩图的ImageMetaData对象,并利用对应的节点对象的方法GetMetaData(),将获取到的数据保存到对应的ImageMetaData对象中。   10. 如果需要将深度图转换成灰度图来显示,则需要自己将深度值转换成0~255的单通道或者多通道数据,然后直接用来显示。

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧