2.2.2.4.10.1.15 BoundsData

The BoundsData structure describes a rectangular area. It encodes (x,y) values that are based on changes from the previous rectangular position. Each value can be either a 16-bit absolute value or an 8-bit delta value, depending on the amount of change that took place.

The first byte of the BoundsData structure represents a set of flags that specify the type of data that is contained in the BoundsData structure. The flag can represent either an absolute (16-bit) or delta (8-bit) value for each x or y value that is supplied. If the flag is not set, then that x or y value is not present in the BoundsData array. The possible flags are specified below.

For each boundary value, either an 8-bit delta or a 16-bit absolute value MAY be specified. The two possible forms of representation MUST NOT be specified at the same time for any particular boundary. For example, if X_DELTA_LEFT is present, X_ABSOLUTE_LEFT MUST NOT be present.


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

X_ABSOLUTE_LEFT (optional)

Y_ABSOLUTE_TOP (optional)

...

X_ABSOLUTE_RIGHT (optional)

Y_ABSOLUTE_BOTTOM (optional)

...

X_DELTA_LEFT (optional)

Y_DELTA_TOP (optional)

X_DELTA_RIGHT (optional)

Y_DELTA_BOTTOM (optional)

flags (1 byte): A set of flags that has one or more of the following bits set. The flag can represent either an absolute (16-bit) or delta (8-bit) value for each x or y value that is supplied. If a flag is not set, that x or y value is not present in the BoundsData array.

The two possible forms of representation MUST NOT be specified at the same time for any particular boundary. For example, if bit A is enabled, bit E MUST NOT be enabled.


0


1


2


3


4


5


6


7

H

G

F

E

D

C

B

A

Where the bits are defined as:

Value

Description

A

X_ABSOLUTE_LEFT

A 16-bit x (left) value is present.

B

Y_ABSOLUTE_TOP

A 16-bit y (top) value is present.

C

X_ABSOLUTE_RIGHT

A 16-bit x (right) value is present.

D

Y_ABSOLUTE_BOTTOM

A 16-bit y (bottom) value is present.

E

X_DELTA_LEFT

An 8-bit x (left) value is present.

F

Y_DELTA_TOP

An 8-bit y (top) value is present.

G

X_DELTA_RIGHT

An 8-bit x (right) value is present.

H

Y_DELTA_BOTTOM

An 8-bit y (bottom) value is present.

X_ABSOLUTE_LEFT (2 bytes): A 16-bit x (left) value. Present when bit A is set in the flags field.

Y_ABSOLUTE_TOP (2 bytes): A 16-bit y (top) value. Present when bit B is set in the flags field.

X_ABSOLUTE_RIGHT (2 bytes): A 16-bit x (right) value. Present when bit C is set in the flags field.

Y_ABSOLUTE_BOTTOM (2 bytes): A 16-bit y (bottom) value. Present when bit D is set in the flags field.

X_DELTA_LEFT (1 byte): An 8-bit x (left) value. Present when bit E is set in the flags field.

Y_DELTA_TOP (1 byte): An 8-bit y (top) value. Present when bit F is set in the flags field.

X_DELTA_RIGHT (1 byte): An 8-bit x (right) value. Present when bit G is set in the flags field.

Y_DELTA_BOTTOM (1 byte): An 8-bit y (bottom) value. Present when bit H is set in the flags field.