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