({ style, width, ...props })
| 16 | const TensorCamera = cameraWithTensors(Camera); |
| 17 | |
| 18 | export function CustomTensorCamera({ style, width, ...props }) { |
| 19 | const sizeStyle = React.useMemo(() => { |
| 20 | const ratio = width / TEXTURE_SIZE.width; |
| 21 | const cameraWidth = TEXTURE_SIZE.width * ratio; |
| 22 | const cameraHeight = TEXTURE_SIZE.height * ratio; |
| 23 | return { |
| 24 | maxWidth: cameraWidth, |
| 25 | minWidth: cameraWidth, |
| 26 | maxHeight: cameraHeight, |
| 27 | minHeight: cameraHeight, |
| 28 | }; |
| 29 | }, [width]); |
| 30 | |
| 31 | return ( |
| 32 | <TensorCamera |
| 33 | {...props} |
| 34 | style={[style, sizeStyle]} |
| 35 | cameraTextureWidth={TEXTURE_SIZE.width} |
| 36 | cameraTextureHeight={TEXTURE_SIZE.height} |
| 37 | resizeWidth={TENSOR_SIZE.width} |
| 38 | resizeHeight={TENSOR_SIZE.height} |
| 39 | resizeDepth={3} |
| 40 | /> |
| 41 | ); |
| 42 | } |
nothing calls this directly
no outgoing calls
no test coverage detected