Added in API level 31

MultiResolutionStreamConfigurationMap


public final class MultiResolutionStreamConfigurationMap
extends Object

java.lang.Object
   ↳ android.hardware.camera2.params.MultiResolutionStreamConfigurationMap


Immutable class to store the information of the multi-resolution streams supported by the camera device.

For a logical multi-camera or an ultra high resolution sensor camera, the maximum resolution of images produced by the camera device may be variable. For example, for a logical multi-camera, depending on factors such as current zoom ratio, the camera device may be backed by different physical cameras. If the physical cameras are of different resolutions, the application may intend to consume the variable full resolution images from the physical cameras. For an ultra high resolution sensor camera, the same use case exists where depending on lighting conditions, the camera device may deem it better to run in default mode and maximum resolution mode.

For the use cases described above, multi-resolution output streams can be used by MultiResolutionImageReader to allow the camera device to output variable size maximum-resolution images.

Similarly, multi-resolution input streams can be used for reprocessing of variable size images. In order to reprocess input images of different sizes, the InputConfiguration used for creating reprocessable session can be initialized using the group of input stream configurations returned by getInputInfo(int).

Summary

Public methods

boolean equals(Object obj)

Check if this MultiResolutionStreamConfigurationMap is equal to another MultiResolutionStreamConfigurationMap.

int[] getInputFormats()

Get the input formats in this multi-resolution stream configuration.

Collection<MultiResolutionStreamInfo> getInputInfo(int format)

Get a group of MultiResolutionStreamInfo with the requested input image format

The format should be a supported format (one of the formats returned by getInputFormats()).

int[] getOutputFormats()

Get the output formats in this multi-resolution stream configuration.

Collection<MultiResolutionStreamInfo> getOutputInfo(int format)

Get a group of MultiResolutionStreamInfo with the requested output image format

The format should be a supported format (one of the formats returned by getOutputFormats()).

int hashCode()

Returns a hash code value for the object.

String toString()

Return this MultiResolutionStreamConfigurationMap as a string representation.

Inherited methods

Public methods

equals

Added in API level 31
public boolean equals (Object obj)

Check if this MultiResolutionStreamConfigurationMap is equal to another MultiResolutionStreamConfigurationMap.

Parameters
obj Object: the reference object with which to compare.

Returns
boolean true if the objects were equal, false otherwise

getInputFormats

Added in API level 31
public int[] getInputFormats ()

Get the input formats in this multi-resolution stream configuration.

A logical multi-camera or ultra high resolution sensor camera may support reprocessing images of different resolutions when switching between physical cameras, or between different modes of the ultra high resolution sensor camera. This function returns the formats supported for such case.

The supported output format for an input format can be queried by calling the camera device's StreamConfigurationMap#getValidOutputFormatsForInput.

All image formats returned by this function will be defined in either ImageFormat or in PixelFormat (and there is no possibility of collision).

Returns
int[] an array of integer format, or empty array if no multi-resolution reprocessing is supported This value cannot be null. 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.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, or ImageFormat.JPEG_R

getInputInfo

Added in API level 31
public Collection<MultiResolutionStreamInfo> getInputInfo (int format)

Get a group of MultiResolutionStreamInfo with the requested input image format

The format should be a supported format (one of the formats returned by getInputFormats()).

Parameters
format int: an image format from ImageFormat or PixelFormat 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.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, or ImageFormat.JPEG_R

Returns
Collection<MultiResolutionStreamInfo> a group of supported MultiResolutionStreamInfo. If the format is not a supported multi-resolution input, an empty group is returned. This value cannot be null.

getOutputFormats

Added in API level 31
public int[] getOutputFormats ()

Get the output formats in this multi-resolution stream configuration.

A logical multi-camera or an ultra high resolution sensor camera may support MultiResolutionImageReader to dynamically output maximum resolutions of different sizes (when switching between physical cameras, or between different modes of an ultra high resolution sensor camera). This function returns the formats supported for such case.

All image formats returned by this function will be defined in either ImageFormat or in PixelFormat (and there is no possibility of collision).

Returns
int[] an array of integer format, or empty array if multi-resolution output is not supported This value cannot be null. 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.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, or ImageFormat.JPEG_R

getOutputInfo

Added in API level 31
public Collection<MultiResolutionStreamInfo> getOutputInfo (int format)

Get a group of MultiResolutionStreamInfo with the requested output image format

The format should be a supported format (one of the formats returned by getOutputFormats()).

Parameters
format int: an image format from ImageFormat or PixelFormat 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.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, or ImageFormat.JPEG_R

Returns
Collection<MultiResolutionStreamInfo> a group of supported MultiResolutionStreamInfo. If the format is not a supported multi-resolution output, an empty group is returned. This value cannot be null.

hashCode

Added in API level 31
public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

Returns
int a hash code value for this object.

toString

Added in API level 31
public String toString ()

Return this MultiResolutionStreamConfigurationMap as a string representation.

{@code "MultiResolutionStreamConfigurationMap(Outputs([format1: [w:%d, h:%d, id:%s], ... ... [w:%d, h:%d, id:%s]), [format2: [w:%d, h:%d, id:%s], ... [w:%d, h:%d, id:%s]], ...), Inputs([format1: [w:%d, h:%d, id:%s], ... [w:%d, h:%d, id:%s], ...).

Returns
String string representation of MultiResolutionStreamConfigurationMap