AmbientBacklightMetadata


public final class AmbientBacklightMetadata
extends Object implements Parcelable

java.lang.Object
   ↳ android.media.quality.AmbientBacklightMetadata


Metadata of ambient backlight.

A metadata instance is sent from ambient backlight hardware in a AmbientBacklightEvent with AmbientBacklightEvent.AMBIENT_BACKLIGHT_EVENT_METADATA_AVAILABLE.

Summary

Constants

int ALGORITHM_NONE

The compress algorithm is disabled.

int ALGORITHM_RLE

The compress algorithm is run length encoding (RLE).

Inherited constants

Fields

public static final Creator<AmbientBacklightMetadata> CREATOR

Public constructors

AmbientBacklightMetadata(String packageName, int compressAlgorithm, int source, int colorFormat, int horizontalZonesNumber, int verticalZonesNumber, int[] zonesColors)

Constructs AmbientBacklightMetadata.

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

int getColorFormat()

Gets color format.

int getCompressionAlgorithm()

Gets compress algorithm.

int getHorizontalZonesCount()

Gets the number of horizontal color zones.

String getPackageName()

Gets package name of the metadata.

int getSource()

Gets source of ambient backlight detection.

int getVerticalZonesCount()

Gets the number of vertical color zones.

int[] getZoneColors()

Gets color data of all available color zones.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

ALGORITHM_NONE

public static final int ALGORITHM_NONE

The compress algorithm is disabled.

Constant Value: 0 (0x00000000)

ALGORITHM_RLE

public static final int ALGORITHM_RLE

The compress algorithm is run length encoding (RLE).

Constant Value: 1 (0x00000001)

Fields

CREATOR

public static final Creator<AmbientBacklightMetadata> CREATOR

Public constructors

AmbientBacklightMetadata

public AmbientBacklightMetadata (String packageName, 
                int compressAlgorithm, 
                int source, 
                int colorFormat, 
                int horizontalZonesNumber, 
                int verticalZonesNumber, 
                int[] zonesColors)

Constructs AmbientBacklightMetadata.

Parameters
packageName String

compressAlgorithm int: Value is ALGORITHM_NONE, or ALGORITHM_RLE

source int: Value is AmbientBacklightSettings.SOURCE_NONE, AmbientBacklightSettings.SOURCE_AUDIO, AmbientBacklightSettings.SOURCE_VIDEO, or AmbientBacklightSettings.SOURCE_AUDIO_VIDEO

colorFormat int: Value is PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGBA_F16, PixelFormat.RGBA_1010102, PixelFormat.RGB_888, PixelFormat.RGB_565, or android.graphics.PixelFormat.R_8

horizontalZonesNumber int

verticalZonesNumber int

zonesColors int

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getColorFormat

public int getColorFormat ()

Gets color format.

Returns
int Value is PixelFormat.RGBA_8888, PixelFormat.RGBX_8888, PixelFormat.RGBA_F16, PixelFormat.RGBA_1010102, PixelFormat.RGB_888, PixelFormat.RGB_565, or android.graphics.PixelFormat.R_8

getCompressionAlgorithm

public int getCompressionAlgorithm ()

Gets compress algorithm.

Returns
int Value is ALGORITHM_NONE, or ALGORITHM_RLE

getHorizontalZonesCount

public int getHorizontalZonesCount ()

Gets the number of horizontal color zones.

A color zone is represented by one single aggregated color. The number should not be larger than 128.

Returns
int Value is between 0 and 128 inclusive

getPackageName

public String getPackageName ()

Gets package name of the metadata.

Returns
String

getVerticalZonesCount

public int getVerticalZonesCount ()

Gets the number of vertical color zones.

A color zone is represented by one single aggregated color. The number should not be larger than 80.

Returns
int Value is between 0 and 80 inclusive

getZoneColors

public int[] getZoneColors ()

Gets color data of all available color zones.

The format of the color data can be found at getColorFormat().

Returns
int[] an array of color data, in row by row (left-to-right then top-to-bottom) order of the color zones.

toString

public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES