size property

(int, int)? get size

The resolution of the video frame, represented as a tuple (width, height).

This reflects the native dimensions of the incoming camera frames, based on the actual sensor data (not the on-screen display size).

Returns null if the camera data has not been received or is not available.

Implementation

(int, int)? get size {
  final int width;
  final int height;

  if (configurationOverride != null) {
    width = configurationOverride!.frameWidth;
    height = configurationOverride!.frameHeight;
  } else {
    final SenseData? camera = datasource.getLatestData(DataType.camera);
    if (camera is! CameraImpl) {
      return null;
    }

    width = camera.cameraConfiguration.frameWidth;
    height = camera.cameraConfiguration.frameHeight;
  }

  if (Platform.isIOS) {
    return (height, width);
  }

  return (width, height);
}