mrousavy / vision-camera-resize-plugin

A VisionCamera Frame Processor plugin for fast buffer resizing and colorspace (YUV <> RGBA) conversions
https://mrousavy.com
MIT License
93 stars 23 forks source link

Added RGBA support for Android. #64

Closed pweglik closed 6 months ago

pweglik commented 6 months ago

I'm not sure about C++ and Kotlin practices, but I added function that performs RGBA -> ARGB frame buffer conversion. This way, you can use resize plugin with Skia Frame processor from vision camera v4.

pweglik commented 6 months ago
  1. I added getFormat, but those int values come from: https://developer.android.com/reference/android/graphics/ImageFormat and https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888 I'm not really proficient in JNI and native code, so for now I left hardcoded in C++.
  2. Done
  3. I don't really know Swift/ObjC, so I can't help here. Also I think it works on iOS, as I've received no error when I set Camera props to 'rgb'.
lin826 commented 5 months ago

Looking forward to the new release with this support for Android ❤️