简体   繁体   English

QImage格式Format_ARGB32数据是带符号的还是无符号的int?

[英]Is QImage format Format_ARGB32 data signed or unsigned int?

I want to convert a QImage of format RGB888 to ARGB32 & fetch pixel data as unsigned int*. 我想将RGB888格式的QImage转换为ARGB32并获取像素数据为unsigned int *。

I can do the following to convert to ARGB32 我可以执行以下操作以转换为ARGB32

QImage new = old.convertToFormat(QImage::Format_ARGB32); QImage新= old.convertToFormat(QImage :: Format_ARGB32);

However, are the pixels stored signed or unsigned? 但是,存储的像素是带符号的还是无符号的?

EDIT: 编辑:

I need a pointer unsigned int* data, such that, 我需要一个无符号的指针int *数据,这样,

an unsigned int (32 bits) holds a pixel in ARGB format, which from left to right is as follows: 一个无符号的int(32位)保存一个ARGB格式的像素,从左到右如下:

  • the first 8 bits are for the alpha channel (and are ignored) 前8位用于Alpha通道(并被忽略)
  • the next 8 bits are for the red channel 接下来的8位是红色通道
  • the next 8 bits are for the green channel 接下来的8位是绿色通道
  • the last 8 bits are for the blue channel 最后8位用于蓝色通道

How do I do this? 我该怎么做呢?

像素存储为QRgb ,这是unsigned int的typedef。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM