transalateWidth function
double
transalateWidth(
- double a,
- Size canvasSize,
- Size imageSize,
- InputImageRotation rotation,
- CameraLensDirection cameraLensDirection,
)
Implementation
double transalateWidth(
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.width : imageSize.height);
case InputImageRotation.rotation0deg:
case InputImageRotation.rotation180deg:
return a * canvasSize.width / imageSize.width;
}
}