frameStats static method
Mean luma + focus (variance of Laplacian) for a grayscale frame.
Implementation
static FrameStats frameStats(
Uint8List gray,
int width,
int height,
int stride,
) {
final input = calloc<Uint8>(gray.length);
final luma = calloc<Float>(1);
final focus = calloc<Float>(1);
try {
input.asTypedList(gray.length).setAll(0, gray);
_frameStats(input, width, height, stride, luma, focus);
return FrameStats(luma.value, focus.value);
} finally {
calloc.free(input);
calloc.free(luma);
calloc.free(focus);
}
}