Sets or updates the origin metadata field, which records where the (0,0)
coordinate sits relative to the recording frame. When the new origin
differs from the current one, the y coordinates are reflected around
y_height so the data is expressed in the new convention.
Value
The aniframe with reflected y coordinates (when the origin changed)
and updated origin metadata.
Details
The flip uses the formula y_new = y_height - y_old. The y_height
metadata field must therefore be set when the origin actually changes; if
it is NA, this function errors and asks the user to set it via
set_y_height(). When the supplied origin matches the current value,
the data is returned unchanged.
Examples
if (FALSE) { # \dontrun{
data <- example_aniframe()
data <- set_y_height(data, y_height = 1080)
data <- set_origin(data, origin = "top_left")
} # }