CGBitmapInfo文档译文

CGBitmapInfo

Component information for a bitmap image.(位图的组成信息)

Declaration

typedef enum CGBitmapInfo : uint32_t {
    ...
} CGBitmapInfo;

Overview

Applications that store pixel data in memory using ARGB format must take care in how they read data. If the code is not written correctly, it’s possible to misread the data which leads to colors or alpha that appear wrong. The byte order constants specify the byte ordering of pixel formats. To specify byte ordering, use a bitwise OR operator to combine the appropriate constant with the bitmapInfo parameter.

应用程序使用ARGB将像素存储进内存时应格外注意如何读取像素数据。如果代码编写错误,则会造成颜色或alpha值显示错误。字节顺序常量指定了像素格式。使用按位或运算符将bitmapInfo中的常量参数组合,以达到正确的字节存储顺序要求。

Topics

Constants

kCGBitmapAlphaInfoMask

 alpha信息的掩码。使用此项可提取指定位图是否包含alpha通道以及如何生成alpha通道的alpha信息
 kCGBitmapAlphaInfoMask = 0x1F

kCGBitmapFloatComponents
 kCGBitmapFloatComponents = (1 << 8)

 使用浮点值来标记位图

kCGBitmapByteOrderMask
 位图的字节排列顺序
⋓kCGBitmapByteOrderMask = kCGImageByteOrderMask

kCGBitmapByteOrderDefault
 kCGBitmapByteOrderDefault = kCGImageByteOrderDefault

 默认的字节排列顺序

kCGBitmapByteOrder16Little

 16位小端字节序

kCGBitmapByteOrder32Little

 32位小端字节序

kCGBitmapByteOrder16Big

 16位大端字节序

kCGBitmapByteOrder32Big

 32位大端字节序

你可能感兴趣的:(CGBitmapInfo文档译文)