ColorSpaceProfiles


public final class ColorSpaceProfiles
extends Object

java.lang.Object
   ↳ 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 CameraCharacteristics.REQUEST_AVAILABLE_COLOR_SPACE_PROFILES.

All camera devices supporting the CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES capability must advertise the supported color space profiles in getSupportedColorSpaces(int)

Summary

Constants

int UNSPECIFIED

Public constructors

ColorSpaceProfiles(long[] elements)

Create a new immutable ColorSpaceProfiles instance.

Public methods

Set<ColorSpace.Named> getSupportedColorSpaces(int imageFormat)

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

Set<ColorSpace.Named> getSupportedColorSpacesForDynamicRange(int imageFormat, long dynamicRangeProfile)

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

Set<Long> getSupportedDynamicRangeProfiles(ColorSpace.Named colorSpace, int imageFormat)

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

Set<Integer> getSupportedImageFormatsForColorSpace(ColorSpace.Named colorSpace)

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

Inherited methods

Constants

UNSPECIFIED

Added in API level 34
public static final int UNSPECIFIED

Constant Value: -1 (0xffffffff)

Public constructors

ColorSpaceProfiles

Added in API level 34
public ColorSpaceProfiles (long[] elements)

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 CameraCharacteristics.REQUEST_AVAILABLE_COLOR_SPACE_PROFILES. for a given camera id in order to retrieve the device capabilities.

Parameters
elements long: 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.

Throws
IllegalArgumentException if the elements array length is invalid, not divisible by 3 or contains invalid element values
NullPointerException if elements is null

Public methods

getSupportedColorSpaces

Added in API level 34
public Set<ColorSpace.Named> getSupportedColorSpaces (int imageFormat)

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 ImageFormat.UNKNOWN, PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGB_888, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.YCBCR_P010, ImageFormat.YCBCR_P210, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, ImageFormat.HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or ImageFormat.JPEG_R

Returns
Set<ColorSpace.Named> set of color spaces This value cannot be null.

getSupportedColorSpacesForDynamicRange

Added in API level 34
public Set<ColorSpace.Named> getSupportedColorSpacesForDynamicRange (int imageFormat, 
                long dynamicRangeProfile)

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 ImageFormat.UNKNOWN, PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGB_888, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.YCBCR_P010, ImageFormat.YCBCR_P210, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, ImageFormat.HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or ImageFormat.JPEG_R

dynamicRangeProfile long: Value is DynamicRangeProfiles.STANDARD, DynamicRangeProfiles.HLG10, DynamicRangeProfiles.HDR10, DynamicRangeProfiles.HDR10_PLUS, DynamicRangeProfiles.DOLBY_VISION_10B_HDR_REF, DynamicRangeProfiles.DOLBY_VISION_10B_HDR_REF_PO, DynamicRangeProfiles.DOLBY_VISION_10B_HDR_OEM, DynamicRangeProfiles.DOLBY_VISION_10B_HDR_OEM_PO, DynamicRangeProfiles.DOLBY_VISION_8B_HDR_REF, DynamicRangeProfiles.DOLBY_VISION_8B_HDR_REF_PO, DynamicRangeProfiles.DOLBY_VISION_8B_HDR_OEM, or DynamicRangeProfiles.DOLBY_VISION_8B_HDR_OEM_PO

Returns
Set<ColorSpace.Named> set of color spaces This value cannot be null.

getSupportedDynamicRangeProfiles

Added in API level 34
public Set<Long> getSupportedDynamicRangeProfiles (ColorSpace.Named colorSpace, 
                int imageFormat)

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 ImageFormat.UNKNOWN, PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGB_888, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.YCBCR_P010, ImageFormat.YCBCR_P210, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, ImageFormat.HEIC, android.graphics.ImageFormat.HEIC_ULTRAHDR, or ImageFormat.JPEG_R

Returns
Set<Long> set of dynamic range profiles. This value cannot be null.

getSupportedImageFormatsForColorSpace

Added in API level 34
public Set<Integer> getSupportedImageFormatsForColorSpace (ColorSpace.Named colorSpace)

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.

Returns
Set<Integer> set of image formats This value cannot be null.