CameraTrackingImageStatus.parse constructor

CameraTrackingImageStatus.parse(
  1. ByteData data_
)

Implementation

factory CameraTrackingImageStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < CameraTrackingImageStatus.mavlinkEncodedLength) {
    var len =
        CameraTrackingImageStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var pointX = data_.getFloat32(0, Endian.little);
  var pointY = data_.getFloat32(4, Endian.little);
  var radius = data_.getFloat32(8, Endian.little);
  var recTopX = data_.getFloat32(12, Endian.little);
  var recTopY = data_.getFloat32(16, Endian.little);
  var recBottomX = data_.getFloat32(20, Endian.little);
  var recBottomY = data_.getFloat32(24, Endian.little);
  var trackingStatus = data_.getUint8(28);
  var trackingMode = data_.getUint8(29);
  var targetData = data_.getUint8(30);

  return CameraTrackingImageStatus(
      pointX: pointX,
      pointY: pointY,
      radius: radius,
      recTopX: recTopX,
      recTopY: recTopY,
      recBottomX: recBottomX,
      recBottomY: recBottomY,
      trackingStatus: trackingStatus,
      trackingMode: trackingMode,
      targetData: targetData);
}