Documentation
¶
Overview ¶
Package rect provides the rectangle type shared by pipeline parameters and result views.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rect ¶
type Rect [4]int
Rect represents a 2D rectangle as [4]int: x, y, width, height.
func (Rect) IsZero ¶
IsZero reports whether both coordinates and both dimensions are zero. It lets the encoding/json "omitzero" option omit empty rectangles, so pipeline defaults and parent-node inheritance apply.
func (*Rect) UnmarshalJSON ¶
UnmarshalJSON decodes a rectangle from a JSON array of integers, mirroring the upstream pipeline parser: [x, y] expands to a 1x1 rectangle at (x, y), and [x, y, w, h] is used as-is. Any other length, null, or non-integer element is an error; on error the rectangle is left unchanged.