Get sizes per ImageFormat/PixelFormat (#119)

* Get sizes per ImageFormat/PixelFormat

* Fix `getOutputMinFrameDuration` crashing

* Fix `isHighestPhotoQualitySupported`

* Add TS type explanations

* Update CameraDevice.ts

* Update CameraViewModule.kt

* Add link to AVCaptureColorSpace apple docs
This commit is contained in:
Marc Rousavy
2021-04-13 13:01:24 +02:00
committed by GitHub
parent 584cd682db
commit 9320e356e3
3 changed files with 139 additions and 59 deletions

View File

@@ -46,14 +46,38 @@ export const parsePhysicalDeviceTypes = (
* Indicates a format's color space.
*
* #### The following colorspaces are available on iOS:
* * `"srgb"`: The sGRB color space (https://www.w3.org/Graphics/Color/srgb)
* * `"srgb"`: The sGRB color space.
* * `"p3-d65"`: The P3 D65 wide color space which uses Illuminant D65 as the white point
* * `"hlg-bt2020"`: The BT2020 wide color space which uses Illuminant D65 as the white point and Hybrid Log-Gamma as the transfer function
*
* > See ["AVCaptureColorSpace"](https://developer.apple.com/documentation/avfoundation/avcapturecolorspace) for more information.
*
* #### The following colorspaces are available on Android:
* * `"yuv"`: The YCbCr color space.
* * `"yuv"`: The Multi-plane Android YCbCr color space. (YUV 420_888, 422_888 or 444_888)
* * `"jpeg"`: The compressed JPEG color space.
* * `"jpeg-depth"`: The compressed JPEG color space including depth data.
* * `"raw"`: The Camera's RAW sensor color space. (Single-channel Bayer-mosaic image, usually 16 bit)
* * `"heic"`: The compressed HEIC color space.
* * `"private"`: The Android private opaque image format. (The choices of the actual format and pixel data layout are entirely up to the device-specific and framework internal implementations, and may vary depending on use cases even for the same device. These buffers are not directly accessible to the application)
* * `"depth-16"`: The Android dense depth image format (16 bit)
* * `"unknown"`: Placeholder for an unknown image/pixel format. [Edit this file](https://github.com/cuvent/react-native-vision-camera/edit/main/android/src/main/java/com/mrousavy/camera/parsers/ImageFormat+String.kt) to add a name for the unknown format.
*
* > See ["Android Color Formats"](https://jbit.net/Android_Colors/) for more information.
*/
export type ColorSpace = 'hlg-bt2020' | 'p3-d65' | 'srgb' | 'yuv';
export type ColorSpace =
// ios
| 'hlg-bt2020'
| 'p3-d65'
| 'srgb'
// android
| 'yuv'
| 'jpeg'
| 'jpeg-depth'
| 'raw'
| 'heic'
| 'private'
| 'depth-16'
| 'unknown';
/**
* Indicates a format's autofocus system.