In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about what the RGB pixel format is. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.
Explain the pixel format of RGB, the mainstream are RGB565,RGB555, RGB24,RGB32, ARGB32, each format according to the introduction, storage schematic map, and the method of obtaining specific pixels to explain. Next, let's get down to business:
RGB565:
a. Overview:
In RGB565 format, each pixel is represented by 16 bit, 2 bytes, 1 WORD, R, G, B are represented by 5, 6, 5 bit respectively, hence the name.
b. Storage hint:
c. Method to get specific pixel values:
According to the storage mode of RGB565, we can get the value of RMagne GMagne B component. Now assume that the variable that stores a pixel in the computer is color, and the data type is short. Then there are:
R = color & 0xF800, (get 5 bit of high bytes)
G = color & 0x07E0, (get the middle 6 bit)
B = color & 0x001F, (get 5 low-byte bit)
2. RGB55:
a. Overview:
RGB55, which means that a pixel is represented by 16 bit = = 2 bytes = = 1 WORD, but the highest bit is not needed. R, G, B are represented by 5 bit each.
b. Storage hint:
c. Method to get specific pixel values:
According to the storage mode of RGB565, we can get the value of RMagne GMagne B component. Now assume that the variable that stores a pixel in the computer is color, and the data type is short. Then there are:
R = color & 0x7C00, (get 5 bit of high bytes)
G = color & 0x03E0, (get the middle 5 bit)
B = color & 0x001F, (get 5 low-byte bit)
3.RGB24:
a. Overview:
RGB24, a pixel is represented by 24 bit = = 3 bytes, and the R, G and B components are represented by 8 bit respectively.
b. Storage hint (note that the RGB24 format is stored as BGR):
c. Method to get specific pixel values:
According to the storage mode of RGB565, we can get the value of RMagne GMagne B component. Now assume that the variable that stores a pixel in the computer is color, and the data type is int. Then there are:
R = color & 0x000000FF
G = color & 0x0000FF00
B = color & 0x00FF0000
4.RGB32:
a. Overview:
RGB32, a pixel is represented by 32 bit = = 4 bytes = = 2 WORD, R, G, B components are represented by 8 bit, the storage order is B, G, R, and the last 8 bytes are reserved.
b. Storage hint:
c. Method to get specific pixel values:
According to the storage mode of RGB565, we can get the value of RMagne GMagne B component. Now assume that the variable that stores a pixel in the computer is color, and the data type is short. Then there are:
R = color & 0x0000FF00
G = color & 0x00FF0000
B = color & 0xFF000000
5. ARGB32:
a. Overview:
ARGB32 is similar to RGB32, except that RGB32 retains eight BIbit to represent transparency, that is, the value of alpha.
b. Storage hint:
c. Method to get specific pixel values:
According to the storage mode of RGB565, we can get the value of RMagne GMagne B component. Now assume that the variable that stores a pixel in the computer is color, and the data type is short. Then there are:
R = color & 0x0000FF00
G = color & 0x00FF0000
B = color & 0xFF000000
A = color & 0x000000FF
The above is what the RGB pixel format is, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.