词条 | RGBA color space | |||||||||||||||||||||||||||||
释义 |
}} RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually the three-channel RGB color model supplemented with a 4th alpha channel. Alpha indicates how opaque each pixel is and allows an image to be combined over others using alpha compositing, with transparent areas and anti-aliasing of the edges of opaque regions. The term does not define what RGB color space is being used. It also does not state whether or not the colors are premultiplied by the alpha value, and if they are it does not state what color space that premultiplication was done in. This means more information than just "RGBA" is needed to determine how to handle an image. To further confuse the issue, in some contexts the term "RGBA" means a specific layout in memory of the four channels, with other terms such as "BGRA" used for alternatives. In other contexts the alternatives are used more often but the term "RGBA" means any layout. RepresentationIn computer graphics, pixels encoding the RGBA color space information must be stored in computer memory (or in files on disk), in well defined formats. There are several ways to encode RGBA colors, which can lead to confusion when image data is exchanged. These encodings are often denoted by the four letters in some order (e.g. RGBA, ARGB, etc.). Unfortunately, the interpretation of these 4-letter mnemonics is not well established, leading to further confusion. There are two typical ways to understand a mnemonic such as "RGBA":
In a big-endian system, the two schemes are equivalent. This is not the case for a little-endian system, where the two mnemonics are reverses of each other. Therefore, to be unambiguous, it is important to state which ordering is used when referring to the encoding.
RGBA (byte-order)In OpenGL and Portable Network Graphics (PNG), the RGBA (byte-order) is used, where the colors are stored in memory such that R is at the lowest address, G after it, B after that, and A last. On a little endian architecture this is equivalent to ABGR (word-order).[1] Even when there are more than 8 bits per channel (such as 16 bits or floating-point), the channels are still stored in RGBA order. In PNG, the channels are stored as 16-bit integers in network order (big-endian). ARGB (word-order)In the ARGB (word-order) encoding the intensity of each channel sample is defined by 8 bits, and are arranged in memory in such manner that a single 32-bit unsigned integer has the alpha sample in the highest 8 bits, followed by the red sample, green sample and finally the blue sample in the lowest 8 bits: ARGB values are typically expressed using 8 hexadecimal digits, with each pair of the hexadecimal digits representing the values of the Alpha, Red, Green and Blue channel, respectively. For example, On little-endian systems, this is equivalent to BGRA (byte-order). On big-endian systems, this is equivalent to ARGB (byte-order). RGBA hexadecimal (word-order){{Disputed section|date=December 2015}}In some software originating on big-endian machines such as Silicon Graphics, RGBA (word-order) means color is specified similar to ARGB (word-order) but with the alpha in the bottom 8 bits rather than the top. For example, The bytes are stored in memory on a little-endian machine in the order ABGR (byte-order). See also
References1. ^[https://www.w3.org/TR/2003/REC-PNG-20031110/#7Integers-and-byte-order PNG specification] 2. ^Microsoft MSDN XAML Color Structure reference (XAML/WPF/Silverlight), including #aarrggbb and sc# scA,scR,scG,scB External links
1 : Color space |
|||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。