2.2.4.1 CLEARCODEC_BITMAP_STREAM

The CLEARCODEC_BITMAP_STREAM structure encapsulates metadata and a stream of bitmap data encoded using ClearCodec compression techniques. Bitmaps with widths larger than 65,535 pixels and heights larger than 65,535 pixels MUST NOT be encoded using ClearCodec. ClearCodec-compressed bitmap data is transported in the bitmapData field of the RDPGFX_WIRE_TO_SURFACE_PDU_1 (section 2.2.2.1) message.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

flags

seqNumber

glyphIndex (optional)

compositePayload (variable)

...

...

flags (1 byte):  An 8-bit unsigned integer that specifies glyph and control flags.

Flag

Meaning

CLEARCODEC_FLAG_GLYPH_INDEX

0x01

Indicates that the glyphIndex field is present. This flag MUST NOT be used in conjunction with a bitmap that has an area larger than 1024 square pixels.

CLEARCODEC_FLAG_GLYPH_HIT

0x02

Indicates the source of the glyph data. This flag MUST NOT be present if the CLEARCODEC_FLAG_GLYPH_INDEX (0x01) flag is not present.

If the CLEARCODEC_FLAG_GLYPH_HIT flag is not present, the glyph data is present in the compositePayload field. The decompressed payload MUST be placed in the Decompressor Glyph Storage (section 3.3.1.9) ADM element at the index specified by the glyphIndex field.

If the CLEARCODEC_FLAG_GLYPH_HIT flag is present, the glyph data is already present in the Decompressor Glyph Storage ADM element at the index specified by the glyphIndex field. In this case, the compositePayload field MUST NOT be present.

CLEARCODEC_FLAG_CACHE_RESET

0x04

Indicates that both the V-Bar Storage Cursor (section 3.3.1.11) ADM element and Short V-Bar Storage Cursor (section 3.3.1.13) ADM element MUST be reset to 0 before decoding the stream.

seqNumber (1 byte):  An 8-bit unsigned integer that specifies the sequencing of the stream. For the first ClearCodec message in the remote session, this value MUST be 0x00. In subsequent messages, the value of the seqNumber field MUST be equal to the value of the seqNumber field in the previous ClearCodec message plus one. The sequence number counter wraps around the value 0xFF, with 0x00 following message 0xFF.

glyphIndex (2 bytes, optional):  An optional 16-bit unsigned integer that specifies the position in the Decompressor Glyph Storage ADM element for the current glyph. This field MUST NOT be present if the CLEARCODEC_FLAG_GLYPH_INDEX (0x01) flag is not present in the flags field. If this field is present, its value MUST be in the range 0 (0x0000) to 3,999 (0x0F9F), inclusive.

compositePayload (variable):  An optional variable-length CLEARCODEC_COMPOSITE_PAYLOAD (section 2.2.4.1.1) structure. This field MUST NOT be present if the CLEARCODEC_FLAG_GLYPH_INDEX (0x01) flag and the CLEARCODEC_FLAG_GLYPH_HIT (0x02) flag are both present in the flags field.