2.2.4.1.1.1.1 CLEARCODEC_RGB_RUN_SEGMENT

The CLEARCODEC_RGB_RUN_SEGMENT structure encodes a single RGB 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

blueValue

greenValue

redValue

runLengthFactor1

runLengthFactor2 (optional)

runLengthFactor3 (optional)

...

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

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

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

runLengthFactor1 (1 byte):  An 8-bit unsigned integer. If this value is less than 255 (0xFF), the runLengthFactor2 and runLengthFactor3 fields MUST NOT be present, and the current pixel MUST be repeated for the next runLengthFactor1 positions. If the runLengthFactor1 field equals 255 (0xFF), the runLengthFactor2 field MUST be present, and the run length is calculated from the runLengthFactor2 field. The value of runLengthFactor1 MUST be greater than zero.

runLengthFactor2 (2 bytes, optional):  An optional 16-bit unsigned integer. If this value is less than 65,535 (0xFFFF), the runLengthFactor3 field MUST NOT be present, and the current pixel MUST be repeated for the next runLengthFactor2 positions. If the runLengthFactor2 field equals 65,535 (0xFFFF), the runLengthFactor3 field MUST be present (and nonzero), and the run length is calculated from the runLengthFactor3 field. If present, the value of runLengthFactor2 MUST be greater than zero.

runLengthFactor3 (4 bytes, optional):  An optional 32-bit unsigned integer. If this field is present, it contains the run length, and the current pixel MUST be repeated for the next runLengthFactor3 positions. This field SHOULD NOT be used if the run length is smaller than 65,535 (0xFFFF). If present, the value of runLengthFactor3 MUST be greater than zero.