SDL2函数简单介绍06

本篇介绍用到的结构体
1.SDL_PixelFormat
Uint32 format 一个枚举值one of the SDL_PixelFormatEnum values
SDL_Palette* palette 和像素相关的调色板an SDL_Palette structure associated with this pixel format, or NULL if the format doesn’t have a palette
Uint8 BitsPerPixel 像素值中有意义的位the number of significant bits in a pixel value, eg: 8, 15, 16, 24, 32
Uint8 BytesPerPixel 保存像素值所需的字节数the number of bytes required to hold a pixel value, eg: 1, 2, 3, 4; see Remarks for related data type
Uint32 Rmask 一种掩码,表示像素的红色部分的位置a mask representing the location of the red component of the pixel
Uint32 Gmask 一种掩码,表示像素的绿色部分的位置a mask representing the location of the green component of the pixel
Uint32 Bmask 一种掩码,表示像素的蓝色部分的位置a mask representing the location of the blue component of the pixel
Uint32 Amask 表示像素的alpha组件位置的掩码,如果像素格式没有任何alpha信息,则为0a mask representing the location of the alpha component of the pixel or 0 if the pixel format doesn’t have any alpha information
2.SDL_Palette
调色板信息的结构体
成员:
int ncolors 调色板上颜色的数目the number of colors in the palette
SDL_Color* colors 代表调色板的SDL_Color结构数组an array of SDL_Color structures representing the palette
3.SDL_Color
代表一种颜色的结构体
成员:
Uint8 r 红the red component in the range 0-255
Uint8 g 绿the green component in the range 0-255
Uint8 b 蓝the blue component in the range 0-255
Uint8 a the alpha component in the range 0-255

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值