Image processing ARGB的像素格式数据结构

Image processing ARGB的像素格式数据结构,image-processing,vnc,vnc-server,argb,rfb-protocol,Image Processing,Vnc,Vnc Server,Argb,Rfb Protocol,我正在用Java实现RFB协议VNC服务器。 我无法理解协议中提供的PIXEL_格式。 像素格式数据结构的定义为: +--------------+--------------+-----------------+ | No. of bytes | Type [Value] | Description | +--------------+--------------+-----------------+ | 1 | U8 | bits-per-p

我正在用Java实现RFB协议VNC服务器。 我无法理解协议中提供的PIXEL_格式。 像素格式数据结构的定义为:

+--------------+--------------+-----------------+
| No. of bytes | Type [Value] | Description     |
+--------------+--------------+-----------------+
| 1            | U8           | bits-per-pixel  |
| 1            | U8           | depth           |
| 1            | U8           | big-endian-flag |
| 1            | U8           | true-color-flag |
| 2            | U16          | red-max         |
| 2            | U16          | green-max       |
| 2            | U16          | blue-max        |
| 1            | U8           | red-shift       |
| 1            | U8           | green-shift     |
| 1            | U8           | blue-shift      |
| 3            |              | padding         |
+--------------+--------------+-----------------+
RFB协议详细定义了每个标志的含义,但我仍然无法确定原始ARGB图像的正确值。我使用以下值:

bits-per-pixel  = 32
depth       = 32
big-endian-flag = 1
true-color-flag = 1
red-max         = 255
green-max   = 255   
blue-max    = 255   
red-shift   = 0
green-shift = 0
blue-shift  = 0
padding     = 0
在使用RealVNC客户端时,我得到了灰度图像,而在使用TightVNC客户端时,我得到了并列的四个不同的图像层


有人能帮我得到正确的编码吗?

在我的例子中,fb将数据存储为小端字节中的bgra ARGB。所以我使用了红移=16绿移=8蓝移=0,我认为你应该从fb_varscreeninfo结构中正确地得到这个移位数据