[Icore dual-core development board tutorial] [BMP file structure and Decoding Implementation]

Source: Internet
Author: User

This article is copyrighted by xiaomagee. For more information, see the source.

_____________________________________

In-depth CommunicationQqGROUP:

A: 204255896(500Super people, full staff)B: 165201798(500Super people, full staff)
C: 215053598
(200High personnel group, full personnel)D: 215054675(200Senior Group)

E: 215055211(200Senior Group)F: 78538605(500Senior Group)

G: 158560047(500High personnel group, full personnel)

YYGroup:7182393

YYChannels:80518139(Irregular speech group courses)

 

Forum:Http://www.heijin.org

Store:Http://i-board.taobao.com

Blog:Http://XiaomaGee.cnblogs.com

 

Tip: Please follow the forums and blogs to view the latest version of this document.

_____________________________________

1. Overview of BMP Images

Modern portable devices often need to display some images in the system. The BMP format is one of the most representative. BMP (Bitmap) is a standard image file format in Windows operating systems. It is widely used and has nothing to do with hardware devices. It uses a bit ing storage format. The image depth of a BMP file can be 1, 4, 8, 16, or 24bit. The data in the data area is linear, with the primary order of the row, followed by the B value of point 1, the G value of point 1, and the R value of point 1, B value of point 2, G value of point 2, R value of point 2, and so on. Note: In Windows, BMP files are generally read in accordance with the line-backward scan conventions. At this time, the image scanning method is from left to right, from bottom to top. Scan Method 1:

1. BMP file format

The data of a BMP file is generally composed of four parts: the bitmap file header, bitmap information header, palette, and bitmap data, as shown in table 1.

Table 1 bitmap file classification

Block name

Size/bit

Bitmap File Header

14

Bitmap header

40

Color palette (optional)

8 (1-Bit Bitmap palette)

64 (4-Bit Bitmap palette)

1024 (8-Bit Bitmap palette)

Bitmap data

Determined by the actual size of the image

The Bitmap header and information header of the BMP file are the first data in the file and can be called the BMP data header. The BMP data header structure is the main structure of the BMP file, suchCode1.

Code 1 BMP data header Structure

Typedef_ PackedStruct{

Unsigned CharType [2];

Unsigned Long IntFile_size;

Unsigned Long IntReserved;

Unsigned Long IntOffset;

Unsigned Long IntHeader_info_size; // 0x28

Unsigned Long IntWidth; // The width of the captured bitmap.

Unsigned Long IntHeight;

Unsigned Short IntPlanes; // The number of bit faces of a bitmap, which is usually 1

Unsigned Short IntBit_count; // 1 4 8 16 24 32

Unsigned Long IntCompression; // Compression

Unsigned Long IntImage_size; // can set 0 (RGB)

Unsigned Long IntXpels_per_meter; // horizontal resolution per meter

Unsigned Long IntYpels_per_meter;

Unsigned Long IntColor_used; // number of colors used

Unsigned Long IntColor_important; // specify the number of important colors

} BMP _header_t;

 

.............................................

Download the PDF full text and code package:

Http://files.cnblogs.com/xiaomagee/iCore_bmp_pub.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.