optris_sdk_region_shape
One placed shape of a region's geometry.
Until this existed the ABI had getters for centre, size and rotation only, all of them describing the first leaf, so a polygon and an ellipse of the same bounding box were indistinguishable and a polygon's vertices were unreachable. A region read back with optris_sdk_imager_copy_region() could therefore not be drawn.
Public attributes
struct_size
uint32_t struct_size
Set to sizeof(optris_sdk_region_shape).
primitive
optris_sdk_region_primitive primitive
Which canonical shape.
centre
optris_sdk_vec2 centre
Where it sits, in region coordinates.
size
optris_sdk_vec2 size
Its full width and height -- not half-extents.
rotation_rad
float rotation_rad
Its rotation about centre, anticlockwise, in radians.
point_count
uint32_t point_count
OPTRIS_SDK_PRIMITIVE_POLYGON: how many vertices it has. OPTRIS_SDK_PRIMITIVE_SPLINE: how many control points it has, which for a closed curve includes the last one repeating the first. Either way it is what optris_sdk_region_read_shape_points() will return, and for a spline it is not the number of points to draw -- that is optris_sdk_region_read_shape_curve(). Zero for every other primitive.
has_shear
uint8_t has_shear
Non-zero when the leaf's transform carries a shear, which centre, size and rotation_rad cannot represent. They are then a best-effort approximation rather than exact. Zero for every region built by the SDK's own constructors.
reserved0
uint8_t reserved0[3]
Reserved; always zero.