Summary
Use the shared skImageToBuffer helper across the computer-vision demo screens instead of the inline readPixels() → buffer boilerplate. Demo-app cleanup only; no library change.
Context
#1292 added skImageToBuffer (apps/computer-vision/utils.ts) and the new image-embeddings screen uses it. The remaining CV demo screens still hand-roll the same conversion. Raised by @barhanc in review of #1292; kept out of that PR to keep it scoped to embeddings.
Scope
Replace the inline pixel-read block with skImageToBuffer(skiaImage) in:
Mechanical and behavior-preserving — only the readPixels()/buffer construction changes.
Out of scope
- Do not touch the
useSafeAreaInsets / insets.bottom padding — all screens use it consistently and it should stay.
- Demo apps only; the
react-native-executorch package is unaffected.
Context / follows
Summary
Use the shared
skImageToBufferhelper across the computer-vision demo screens instead of the inlinereadPixels()→ buffer boilerplate. Demo-app cleanup only; no library change.Context
#1292 added
skImageToBuffer(apps/computer-vision/utils.ts) and the new image-embeddings screen uses it. The remaining CV demo screens still hand-roll the same conversion. Raised by @barhanc in review of #1292; kept out of that PR to keep it scoped to embeddings.Scope
Replace the inline pixel-read block with
skImageToBuffer(skiaImage)in:apps/computer-vision/app/classification/index.tsxapps/computer-vision/app/detection/index.tsxapps/computer-vision/app/segmentation/index.tsxapps/computer-vision/app/instanceSegmentation/index.tsxapps/computer-vision/app/keypoint/index.tsxapps/computer-vision/app/styleTransfer/index.tsxMechanical and behavior-preserving — only the
readPixels()/buffer construction changes.Out of scope
useSafeAreaInsets/insets.bottompadding — all screens use it consistently and it should stay.react-native-executorchpackage is unaffected.Context / follows