MCPcopy Create free account
hub / github.com/a7medev/react-native-ml-kit / scaleFramePortrait

Function scaleFramePortrait

example/src/core/scaling.ts:68–86  ·  view source on GitHub ↗
(
  screenWidth: number,
  imageWidth: number,
  imageHeight: number,
  frame: Frame,
)

Source from the content-addressed store, hash-verified

66}
67
68function scaleFramePortrait(
69 screenWidth: number,
70 imageWidth: number,
71 imageHeight: number,
72 frame: Frame,
73): Frame {
74 const shown = shownDimensionsPortrait(screenWidth, imageWidth, imageHeight);
75 const point = scalePointPortrait(screenWidth, imageWidth, imageHeight, {
76 x: frame.left,
77 y: frame.top,
78 });
79
80 return {
81 left: point.x,
82 top: point.y,
83 width: (shown.width / imageWidth) * frame.width,
84 height: (shown.height / imageHeight) * frame.height,
85 };
86}
87
88export function scaleFrame(
89 imageWidth: number,

Callers 1

scaleFrameFunction · 0.85

Calls 2

shownDimensionsPortraitFunction · 0.85
scalePointPortraitFunction · 0.85

Tested by

no test coverage detected