MediaAnnotation.h header

#include <ew/core/MediaAnnotation.h>

Namespace ew::core

MediaAnnotation struct

struct ew::core::MediaAnnotation

One annotation drawn over a media image: a shape or text note, positioned in image pixel coordinates, with a stroke colour. For Rectangle and Ellipse the two points are opposite corners; for Arrow they are the tail and the head; for Text the first point is the anchor and the label is carried in text (the second point is unused).

Members

AnnotationType ew::core::MediaAnnotation::type =

The annotation shape.

double ew::core::MediaAnnotation::x1 = 0.0

The first point, in image pixels.

double ew::core::MediaAnnotation::y1 = 0.0

The first point's y-coordinate, in image pixels.

double ew::core::MediaAnnotation::x2 = 0.0

The second point, in image pixels (unused for Text).

double ew::core::MediaAnnotation::y2 = 0.0

The second point's y-coordinate, in image pixels (unused for Text).

QString ew::core::MediaAnnotation::color

Stroke colour as a "#rrggbb" string.

QString ew::core::MediaAnnotation::text

The note text (Text annotations only).

Enumerations

enum class AnnotationType { Rectangle, Ellipse, Arrow, Text }

The shape of an image annotation. New shapes are additive. Serialized as a stable lowercase token.

Functions

std::optional< AnnotationType > ew::core::annotationTypeFromToken(QStringView token)

Parses an annotation type from its serialization token; std::nullopt if unrecognized.

QString ew::core::toToken(AnnotationType type)

Returns the stable serialization token for type (e.g. "rectangle").