Skip to main content

CorePlotting::MaskContourMapper

CorePlotting::MaskContourMapper

Functions

Name
OwningLineView mapMaskContour(Mask2D const & mask, EntityId entity_id, float x_scale =1.0f, float y_scale =1.0f, float x_offset =0.0f, float y_offset =0.0f)
Convert a single Mask2D to a contour polyline.
std::vector< OwningLineView > mapMaskContoursAtTime(MaskData const & masks, TimeFrameIndex time, float x_scale =1.0f, float y_scale =1.0f, float x_offset =0.0f, float y_offset =0.0f)
Map all mask contours at a specific time frame.

Functions Documentation

function mapMaskContour

inline OwningLineView mapMaskContour(
    Mask2D const & mask,
    EntityId entity_id,
    float x_scale =1.0f,
    float y_scale =1.0f,
    float x_offset =0.0f,
    float y_offset =0.0f
)

Convert a single Mask2D to a contour polyline.

Parameters:

  • mask Source mask (sparse pixel set)
  • entity_id Entity identifier for this mask
  • x_scale X coordinate scale
  • y_scale Y coordinate scale
  • x_offset X offset applied after scaling
  • y_offset Y offset applied after scaling

Return: OwningLineView with contour vertices, or empty-vertex view if mask is empty

Uses get_mask_outline() to extract ordered boundary points from the sparse pixel mask, then maps them to an OwningLineView. This allows masks to be rendered through the standard polyline pipeline without a dedicated mask renderer.

function mapMaskContoursAtTime

inline std::vector< OwningLineView > mapMaskContoursAtTime(
    MaskData const & masks,
    TimeFrameIndex time,
    float x_scale =1.0f,
    float y_scale =1.0f,
    float x_offset =0.0f,
    float y_offset =0.0f
)

Map all mask contours at a specific time frame.

Parameters:

  • masks Mask data source
  • time Current time frame index
  • x_scale X coordinate scale
  • y_scale Y coordinate scale
  • x_offset X offset applied after scaling
  • y_offset Y offset applied after scaling

Return: Vector of OwningLineView, one per mask at this time

Extracts masks from MaskData at the given time, converts each to a contour polyline via get_mask_outline(), and returns the set as OwningLineViews.


Updated on 2026-11-13 at 20:25:42 +0000