BMP

以下面这幅图为例

 

上面就是此幅24位图的图像结构,真正的RGB数据是从0x36这位开始的。而且还提供了图片的尺寸width of image data & height of image data。对我们后边进行转换提供了充足的信息。

  差点就忘记说了:bmp文件中还有一个特殊的地方,就是它的数据存储方式是从左下角开始的,如下图所示:
所以在转成YUV格式的时候,还需要将行进行颠倒才能看到正常的YUV图像。

 
offset  
size(byte)
field
data
0x 0
0x 2
0x 6
0x 8
0x a
0x e
0x12
0x16
0x1a
0x1c
0x1e
0x22
0x26
0x2a
0x2e
0x32
0x36
0x36
+4*n
2  
4  
2  
2  
4  
4  
4   
4   
2   
2   
4   
4   
4   
4   
4   
4   
4*n
“BM”                      
File Size(byte)             
(Reserved)                  
(Reserved)                  
start offset of image data  
size of Bitmap Header       
width of image data(pixel)  
height of image data(pixel) 
‘1’                        
bit / pixel (1,2,8,16,24)   
compress mode               
compressed image size       
level resolution( pixel /1m)
vertical resolution(pixel/1m)
numbers of use color        
important color             
color map ( if exists)      
image Data                  
B,G,R,B,G,R,B,G,R .......   
0x42 0x4d         
0x0000e136             
                              
                                
0x00000036                  
0x00000028                   
0x000000a0                      
0x00000078                       
0x0001         
0x0018                     
0                          
0x0000e100                     
N/A                          
N/A                           
0                           
0                       
N/A                       
                                
f0,c0,50,                   
f0,c1,4e,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值