rtc/widgets/annotation_painter library

Functions

canvasToNormalised(Offset position, VideoContentBounds bounds) List<double>?
Converts a canvas pixel offset to a normalised coordinate (0–1). Returns null if the point is outside the video content area.
getRenderedVideoContentBounds({required double containerWidth, required double containerHeight, required double videoWidth, required double videoHeight}) VideoContentBounds
Calculates the actual rendered video area inside a container, accounting for letterboxing (object-fit: contain equivalent).
getStrokeContentScale(double contentHeight) double
Scales stroke width proportionally relative to a 720px reference height.
normalisedToCanvas(double nx, double ny, VideoContentBounds bounds) Offset
Converts a normalised coordinate (0–1) to a canvas pixel offset.