public final class

ColorInfo.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.ColorInfo.Builder

Overview

Builds ColorInfo instances.

Use ColorInfo.buildUpon() to obtain a builder representing an existing ColorInfo.

Summary

Constructors
publicBuilder()

Creates a new instance with default values.

Methods
public ColorInfobuild()

Builds a new ColorInfo instance.

public ColorInfo.BuildersetChromaBitdepth(int chromaBitdepth)

Sets chroma bit depth.

public ColorInfo.BuildersetColorRange(int colorRange)

Sets the color range.

public ColorInfo.BuildersetColorSpace(int colorSpace)

Sets the color space.

public ColorInfo.BuildersetColorTransfer(int colorTransfer)

Sets the color transfer.

public ColorInfo.BuildersetHdrStaticInfo(byte[] hdrStaticInfo[])

Sets the HdrStaticInfo as defined in CTA-861.3.

public ColorInfo.BuildersetLumaBitdepth(int lumaBitdepth)

Sets the luma bit depth.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new instance with default values.

Methods

public ColorInfo.Builder setColorSpace(int colorSpace)

Sets the color space.

Valid values are C.COLOR_SPACE_BT601, C.COLOR_SPACE_BT709, C.COLOR_SPACE_BT2020 or Format.NO_VALUE if unknown.

Parameters:

colorSpace: The color space. The default value is Format.NO_VALUE.

Returns:

This Builder.

public ColorInfo.Builder setColorRange(int colorRange)

Sets the color range.

Valid values are C.COLOR_RANGE_LIMITED, C.COLOR_RANGE_FULL or Format.NO_VALUE if unknown.

Parameters:

colorRange: The color range. The default value is Format.NO_VALUE.

Returns:

This Builder.

public ColorInfo.Builder setColorTransfer(int colorTransfer)

Sets the color transfer.

Valid values are C.COLOR_TRANSFER_LINEAR, C.COLOR_TRANSFER_HLG, C.COLOR_TRANSFER_ST2084, C.COLOR_TRANSFER_SDR or Format.NO_VALUE if unknown.

Parameters:

colorTransfer: The color transfer. The default value is Format.NO_VALUE.

Returns:

This Builder.

public ColorInfo.Builder setHdrStaticInfo(byte[] hdrStaticInfo[])

Sets the HdrStaticInfo as defined in CTA-861.3.

Parameters:

hdrStaticInfo: The HdrStaticInfo. The default value is null.

Returns:

This Builder.

public ColorInfo.Builder setLumaBitdepth(int lumaBitdepth)

Sets the luma bit depth.

Parameters:

lumaBitdepth: The lumaBitdepth. The default value is Format.NO_VALUE.

Returns:

The builder.

public ColorInfo.Builder setChromaBitdepth(int chromaBitdepth)

Sets chroma bit depth.

Parameters:

chromaBitdepth: The chromaBitdepth. The default value is Format.NO_VALUE.

Returns:

The builder.

public ColorInfo build()

Builds a new ColorInfo instance.