登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

图像处理 视频分析 机器视觉 模式识别

方向比努力更重要

 
 
 

日志

 
 
关于我

河北软件开发项目,电子警察卡口项目,公安天网项目,媒体流处理,数字图像处理。媒体服务器 RTSP、图像处理、车牌识别……DCT变换,H.264压缩

bmp文件RGB排列  

2012-08-09 15:20:35|  分类: YUV-RGB |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

BGR的存贮顺序是有道理的,数据的存储都是高位在后,低位在前,所以颜色值倒过来存储就
会比较方便。
因为你用一个DWORD来读一个32位或24位的RGB值,以及用WORD读一个16位的RGB值做位运算
会很方便。

有些东西,可不是第一个人喜欢就变成那个样子的,一定有其原因的。

 

第一个写这个结构的人就是喜欢BGR的顺序,不喜欢RGB的顺序,有什么办法,人家原意。

RGB关系本来就是并列的,没有什么特殊性,给出了定义后就要服从

 

MSDN中有说明啊,摘录给你看看:

Platform   SDK:   Windows   GDI

COLORREF
The   COLORREF   value   is   used   to   specify   an   RGB   color.  

typedef   DWORD   COLORREF;
typedef   DWORD   *LPCOLORREF;
Remarks
When   specifying   an   explicit   RGB   color,   the   COLORREF   value   has   the   following   hexadecimal   form:  

0x00bbggrr  
The   low-order   byte   contains   a   value   for   the   relative   intensity   of   red;   the   second   byte   contains   a   value   for   green;   and   the   third   byte   contains   a   value   for   blue.   The   high-order   byte   must   be   zero.   The   maximum   value   for   a   single   byte   is   0xFF.  

To   create   a   COLORREF   color   value,   use   the   RGB   macro.   To   extract   the   individual   values   for   the   red,   green,   and   blue   components   of   a   color   value,   use   the   GetRValue,   GetGValue,   and   GetBValue   macros,   respectively.  

  评论这张
 
阅读(2422)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018