transalateHiegt function

double transalateHiegt(
  1. double y,
  2. Size canvasSize,
  3. Size imageSize,
  4. InputImageRotation rotation,
  5. CameraLensDirection cameraLensDirection,
)

Implementation

double transalateHiegt(
    double y,
    Size canvasSize,
    Size imageSize,
    InputImageRotation rotation,
    CameraLensDirection cameraLensDirection,
    ) {
  switch (rotation) {
    case InputImageRotation.rotation90deg:
    case InputImageRotation.rotation270deg:
      return y *
          canvasSize.height /
          (Platform.isIOS ? imageSize.height : imageSize.width);
    case InputImageRotation.rotation0deg:
    case InputImageRotation.rotation180deg:
      return y * canvasSize.height / imageSize.height;
  }
}