Scalar mean({Mat? mask}) { final s = calloc<ccore.Scalar>(); mask == null ? cvRun(() => ccore.Mat_Mean(ref, s)) : cvRun(() => ccore.Mat_MeanWithMask(ref, mask.ref, s)); return Scalar.fromPointer(s); }