Added in API level 34

ColorSpaceProfiles

class ColorSpaceProfiles
kotlin.Any
   ↳ android.hardware.camera2.params.ColorSpaceProfiles

Immutable class with information about supported color space profiles.

An instance of this class can be queried by retrieving the value of android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_COLOR_SPACE_PROFILES.

All camera devices supporting the android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES capability must advertise the supported color space profiles in getSupportedColorSpaces

Summary

Constants
static Int

Public constructors

Create a new immutable ColorSpaceProfiles instance.

Public methods
MutableSet<ColorSpace.Named!>

Return a list of color spaces that are compatible with an ImageFormat.

MutableSet<ColorSpace.Named!>
getSupportedColorSpacesForDynamicRange(imageFormat: Int, dynamicRangeProfile: Long)

Return a list of color spaces that are compatible with an ImageFormat and a dynamic range profile.

MutableSet<Long!>

Return a list of dynamic range profiles that are compatible with a color space and ImageFormat.

MutableSet<Int!>

Return a list of image formats that are compatible with a color space.

Constants

UNSPECIFIED

Added in API level 34
static val UNSPECIFIED: Int
Value: -1

Public constructors

ColorSpaceProfiles

Added in API level 34
ColorSpaceProfiles(elements: LongArray)

Create a new immutable ColorSpaceProfiles instance.

This constructor takes over the array; do not write to the array afterwards.

Do note that the constructor is available for testing purposes only! Camera clients must always retrieve the value of android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_COLOR_SPACE_PROFILES. for a given camera id in order to retrieve the device capabilities.

Parameters
elements LongArray: An array of elements describing the map. It contains three elements per entry which describe the supported color space profile value in the first element, a compatible image format in the second, and in the third element a bitmap of compatible dynamic range profiles (see DynamicRangeProfiles#STANDARD and others for the individual bitmap components). This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the elements array length is invalid, not divisible by 3 or contains invalid element values
java.lang.NullPointerException if elements is null

Public methods

getSupportedColorSpaces

Added in API level 34
fun getSupportedColorSpaces(imageFormat: Int): MutableSet<ColorSpace.Named!>

Return a list of color spaces that are compatible with an ImageFormat. If ImageFormat.UNKNOWN is provided, this function will return a set of all unique color spaces supported by the device, regardless of image format. Color spaces which are compatible with ImageFormat.PRIVATE are able to be used with SurfaceView, SurfaceTexture, MediaCodec and MediaRecorder.

Parameters
imageFormat Int: Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<ColorSpace.Named!> set of color spaces This value cannot be null.

getSupportedColorSpacesForDynamicRange

Added in API level 34
fun getSupportedColorSpacesForDynamicRange(
    imageFormat: Int,
    dynamicRangeProfile: Long
): MutableSet<ColorSpace.Named!>

Return a list of color spaces that are compatible with an ImageFormat and a dynamic range profile. If ImageFormat.UNKNOWN is provided, this function will return a set of all unique color spaces compatible with the given dynamic range profile, regardless of image format.

Parameters
imageFormat Int: Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
dynamicRangeProfile Long: Value is android.hardware.camera2.params.DynamicRangeProfiles#STANDARD, android.hardware.camera2.params.DynamicRangeProfiles#HLG10, android.hardware.camera2.params.DynamicRangeProfiles#HDR10, android.hardware.camera2.params.DynamicRangeProfiles#HDR10_PLUS, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_10B_HDR_REF, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_10B_HDR_REF_PO, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_10B_HDR_OEM, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_10B_HDR_OEM_PO, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_8B_HDR_REF, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_8B_HDR_REF_PO, android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_8B_HDR_OEM, or android.hardware.camera2.params.DynamicRangeProfiles#DOLBY_VISION_8B_HDR_OEM_PO
Return
MutableSet<ColorSpace.Named!> set of color spaces This value cannot be null.

getSupportedDynamicRangeProfiles

Added in API level 34
fun getSupportedDynamicRangeProfiles(
    colorSpace: ColorSpace.Named,
    imageFormat: Int
): MutableSet<Long!>

Return a list of dynamic range profiles that are compatible with a color space and ImageFormat. If ImageFormat.UNKNOWN is provided, this function will return a set of all unique dynamic range profiles supported by the device given a color space, regardless of image format.

Parameters
colorSpace ColorSpace.Named: This value cannot be null.
imageFormat Int: Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<Long!> set of dynamic range profiles. This value cannot be null.

getSupportedImageFormatsForColorSpace

Added in API level 34
fun getSupportedImageFormatsForColorSpace(colorSpace: ColorSpace.Named): MutableSet<Int!>

Return a list of image formats that are compatible with a color space. Color spaces which are compatible with ImageFormat.PRIVATE are able to be used with SurfaceView, SurfaceTexture, MediaCodec and MediaRecorder.

Parameters
colorSpace ColorSpace.Named: This value cannot be null.
Return
MutableSet<Int!> set of image formats This value cannot be null.