cropGeometryFrom static method
Snapshot the crop layer's source→output geometry into a
VideoCropGeometry — the export affine (row-major 3×3 from
exportMatrix, whose column-major storage we index by entry) plus
the crop output size. Dimensions are raw here; the send path clamps
them to the quality tier.
Implementation
static VideoCropGeometry cropGeometryFrom(CropImageLayer layer) {
final m = layer.exportMatrix;
final size = layer.exportSize;
return VideoCropGeometry(
transform: <double>[
m.entry(0, 0),
m.entry(0, 1),
m.entry(0, 3),
m.entry(1, 0),
m.entry(1, 1),
m.entry(1, 3),
0,
0,
1,
],
outWidth: size.width.round(),
outHeight: size.height.round(),
);
}