Defines attributes of 2D geometries (including points, lines, rectangles, and polygons) of the lightweight graphics system and provides functions for performing operations on the geometries.
Data Structure Name
Defines a line, which consists of the start and end points.
Defines a polygon, including vertex coordinates and the maximum number of vertices (defined by MAX_VERTEX_NUM).
OHOS::Intersect (const Line &a, const Line &b, Vector2< int16_t > &out)
Checks whether line segment a and line segment b intersect, and returns the intersection point (if available).
OHOS::IsIntersect (const Line &a, const Line &b)
Chekcs whether line segment a and line segment b intersect.
OHOS::Clip (Polygon &poly, const Line &line)
Clips a polygon by using a line segment.
OHOS::SuthHodgClip (const Rect &clipRect, const Polygon &polygon)
Implements Sutherland-Hodgman, an algorithm used for clipping polygons.
OHOS::Clip (const Line &line, const Polygon &poly, Vector2< int16_t > pOut, uint8_t pNum)
Clips a polygon by using a line segment and obtains the intersections.