2.2.4.3.1 CLEARCODEC_ALPHA_RLE_SEGMENT

The CLEARCODEC_ALPHA_RLE_SEGMENT structure encodes a single alpha channel run segment.


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

runValue

runLengthFactor1

runLengthFactor2 (optional)

runLengthFactor3 (optional)

runValue (1 byte): An 8-bit unsigned integer that specifies the alpha value of the current pixel.

runLengthFactor1 (1 byte): An 8-bit unsigned integer. If the value of the runLengthFactor1 field is less than 255 (0xFF), the runLengthFactor2 and runLengthFactor3 fields MUST NOT be present, and the current alpha value MUST be applied to the next runLengthFactor1 pixels. If the value of the runLengthFactor1 field equals 255 (0xFF), the runLengthFactor2 field MUST be present, and the run length is calculated from the runLengthFactor2 field.

runLengthFactor2 (2 bytes, optional): An optional 16-bit unsigned integer. If the value of the runLengthFactor2 field is less than 65,535 (0xFFFF), the runLengthFactor3 field MUST NOT be present, and the current alpha value MUST be applied to the next runLengthFactor2 pixels. If the value of the runLengthFactor2 field equals 65,535 (0xFFFF), the runLengthFactor3 field MUST be present, and the run length is calculated from the runLengthFactor3 field.

runLengthFactor3 (4 bytes, optional): An optional 32-bit unsigned integer. If this field is present, it contains the run length. The current alpha value MUST be applied to the next runLengthFactor3 pixels. This field SHOULD NOT be used if the run length is smaller than 65,535 (0xFFFF).