@@ -294,21 +294,16 @@ class Mat extends CvStruct<cvg.Mat> {
294294 });
295295
296296 num atNum <T extends num >(int row, int col, [int ? i2]) {
297- return using <num >((arena) {
298- final p = arena< ffi.Int > ();
299- cvRun (() => CFFI .Mat_Type (ref, p));
300- final depth = p.value & (MatType .CV_DEPTH_MAX - 1 );
301- return switch (depth) {
302- MatType .CV_8U => atU8 (row, col, i2),
303- MatType .CV_8S => atI8 (row, col, i2),
304- MatType .CV_16U => atU16 (row, col, i2),
305- MatType .CV_16S => atI16 (row, col, i2),
306- MatType .CV_32S => atI32 (row, col, i2),
307- MatType .CV_32F => atF32 (row, col, i2),
308- MatType .CV_64F => atF64 (row, col, i2),
309- _ => throw UnsupportedError ("Unsupported type: $type " )
310- };
311- });
297+ return switch (type.depth) {
298+ MatType .CV_8U => atU8 (row, col, i2),
299+ MatType .CV_8S => atI8 (row, col, i2),
300+ MatType .CV_16U => atU16 (row, col, i2),
301+ MatType .CV_16S => atI16 (row, col, i2),
302+ MatType .CV_32S => atI32 (row, col, i2),
303+ MatType .CV_32F => atF32 (row, col, i2),
304+ MatType .CV_64F => atF64 (row, col, i2),
305+ _ => throw UnsupportedError ("Unsupported type: $type " )
306+ };
312307 }
313308
314309 T atVec <T >(int row, int col) {
0 commit comments