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