supervision-js
    Preparing search index...

    Interface MaskStyle

    Mask presentation contract.

    Styles decide which detections are rendered as masks and how they should look. Expensive mask preparation is owned by the renderer, not by style objects.

    interface MaskStyle {
        artifactKey?: string;
        opacity?: number;
        resolve(
            detection: Detection,
            context: AnnotationStyleContext,
        ): MaskDrawInstruction | undefined;
    }

    Implemented by

    Index
    artifactKey?: string

    Stable identity for the prepared mask pixels. Exclude presentation-only controls such as global opacity so cached mask artifacts can be reused.

    opacity?: number

    Presentation opacity applied by the renderer after the mask artifact is prepared. Use this for cheap live opacity updates.