Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/graphics/Gainmap#constants) \| [Inherited Constants](https://developer.android.com/reference/android/graphics/Gainmap#inhconstants) \| [Fields](https://developer.android.com/reference/android/graphics/Gainmap#lfields) \| [Ctors](https://developer.android.com/reference/android/graphics/Gainmap#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/Gainmap#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/Gainmap#inhmethods)

# Gainmap

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/graphics/Gainmap "View this page in Kotlin") \|Java


`
public

final

class
Gainmap
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.graphics.Gainmap |

<br />

*** ** * ** ***

Gainmap represents a mechanism for augmenting an SDR image to produce an HDR one with variable
display adjustment capability. It is a combination of a set of metadata describing how to apply
the gainmap, as well as either a 1 (such as `https://developer.android.com/reference/android/graphics/Bitmap.Config#ALPHA_8` or 3
(such as `https://developer.android.com/reference/android/graphics/Bitmap.Config#ARGB_8888` with the alpha channel ignored)
channel Bitmap that represents the gainmap data itself.


When rendering to an `https://developer.android.com/reference/android/content/pm/ActivityInfo#COLOR_MODE_HDR` activity, the
hardware accelerated `https://developer.android.com/reference/android/graphics/Canvas` will automatically apply the gainmap when sufficient
HDR headroom is available.

### Gainmap Structure

The logical whole of a gainmap'd image consists of a base Bitmap that represents the original image as would be displayed without gainmap support in addition to a gainmap with a second enhancement image. In the case of a JPEG, the base image would be the typical 8-bit SDR image that the format is commonly associated with. The gainmap image is embedded alongside the base image, often at a lower resolution (such as 1/4th), along with some metadata to describe how to apply the gainmap. The gainmap image itself is then a greyscale image representing the transformation to apply onto the base image to reconstruct an HDR rendition of it.


As such these "gainmap images" consist of 3 parts - a base `https://developer.android.com/reference/android/graphics/Bitmap` with a
`https://developer.android.com/reference/android/graphics/Bitmap#getGainmap()` that returns an instance of this class which in turn contains
the enhancement layer represented as another Bitmap, accessible via `https://developer.android.com/reference/android/graphics/Gainmap#getGainmapContents()`

### Applying a gainmap manually

When doing custom rendering such as to an OpenGL ES or Vulkan context, the gainmap is not automatically applied. In such situations, the following steps are appropriate to render the gainmap in combination with the base image.


Suppose our display has HDR to SDR ratio of H, and we wish to display an image with gainmap on
this display. Let B be the pixel value from the base image in a color space that has the
primaries of the base image and a linear transfer function. Let G be the pixel value from the
gainmap. Let D be the output pixel in the same color space as B. The value of D is computed
as follows:


First, let W be a weight parameter determining how much the gainmap will be applied.

```text
   W = clamp((log(H)                      - log(minDisplayRatioForHdrTransition)) /
             (log(displayRatioForFullHdr) - log(minDisplayRatioForHdrTransition), 0, 1)
```
Next, let L be the gainmap value in log space. We compute this from the value G that was sampled from the texture as follows:

```text
   L = mix(log(ratioMin), log(ratioMax), pow(G, gamma))
```
Finally, apply the gainmap to compute D, the displayed pixel. If the base image is SDR then compute:

```scdoc
   D = (B + epsilonSdr) * exp(L * W) - epsilonHdr
```


In the above math, log() is a natural logarithm and exp() is natural exponentiation. The base
for these functions cancels out and does not affect the result, so other bases may be used
if preferred.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_HDR_TO_SDR` The gainmap will be applied as if the base image were HDR, and fully applying the gainmap results in an SDR image. |
| `int` | `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_SDR_TO_HDR` The gainmap will be applied as if the base image were SDR, and fully applying the gainmap results in an HDR image. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/graphics/Gainmap>` | `https://developer.android.com/reference/android/graphics/Gainmap#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/Gainmap#Gainmap(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap gainmapContents) ` Creates a gainmap from a given Bitmap. |
| ` https://developer.android.com/reference/android/graphics/Gainmap#Gainmap(android.graphics.Gainmap,%20android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Gainmap gainmap, https://developer.android.com/reference/android/graphics/Bitmap gainmapContents) ` Creates a new gainmap using the provided gainmap as the metadata source and the provided bitmap as the replacement for the gainmapContents |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/graphics/Gainmap#describeContents()() ` No special parcel contents. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace` | ` https://developer.android.com/reference/android/graphics/Gainmap#getAlternativeImagePrimaries()() ` Gets the colorspace that the gainmap math should be applied in. |
| ` float` | ` https://developer.android.com/reference/android/graphics/Gainmap#getDisplayRatioForFullHdr()() ` Gets the hdr/sdr ratio at which point applying the gainmap results in an HDR rendition |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/Gainmap#getEpsilonHdr()() ` Gets the hdr epsilon. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/Gainmap#getEpsilonSdr()() ` Gets the sdr epsilon. |
| ` https://developer.android.com/reference/android/graphics/Bitmap` | ` https://developer.android.com/reference/android/graphics/Gainmap#getGainmapContents()() ` |
| ` int` | ` https://developer.android.com/reference/android/graphics/Gainmap#getGainmapDirection()() ` Gets the direction that the gainmap math should be applied in. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/Gainmap#getGamma()() ` Gets the gainmap gamma. |
| ` float` | ` https://developer.android.com/reference/android/graphics/Gainmap#getMinDisplayRatioForHdrTransition()() ` Gets the hdr/sdr ratio below which applying the gainmap results in an SDR rendition. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/Gainmap#getRatioMax()() ` Gets the gainmap ratio max. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/Gainmap#getRatioMin()() ` Gets the gainmap ratio max. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setAlternativeImagePrimaries(android.graphics.ColorSpace)(https://developer.android.com/reference/android/graphics/ColorSpace colorSpace) ` Sets the colorspace that the gainmap math should be applied in. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setDisplayRatioForFullHdr(float)(float max) ` Sets the hdr/sdr ratio at which point applying the gainmap results in an HDR rendition. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setEpsilonHdr(float,%20float,%20float)(float r, float g, float b) ` Sets the hdr epsilon which is used to avoid numerical instability. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setEpsilonSdr(float,%20float,%20float)(float r, float g, float b) ` Sets the sdr epsilon which is used to avoid numerical instability. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setGainmapContents(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap) ` Sets the image data of the gainmap. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setGainmapDirection(int)(int direction) ` Sets the direction that the gainmap math should be applied in. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setGamma(float,%20float,%20float)(float r, float g, float b) ` Sets the gainmap gamma. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setMinDisplayRatioForHdrTransition(float)(float min) ` Sets the hdr/sdr ratio below which applying the gainmap results in an SDR rendition. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setRatioMax(float,%20float,%20float)(float r, float g, float b) ` Sets the gainmap ratio max. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#setRatioMin(float,%20float,%20float)(float r, float g, float b) ` Sets the gainmap ratio min. |
| ` void` | ` https://developer.android.com/reference/android/graphics/Gainmap#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Write the gainmap to the parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### GAINMAP_DIRECTION_HDR_TO_SDR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int GAINMAP_DIRECTION_HDR_TO_SDR
```

The gainmap will be applied as if the base image were HDR, and fully applying the gainmap
results in an SDR image.

<br />

Constant Value:

1
(0x00000001)


### GAINMAP_DIRECTION_SDR_TO_HDR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int GAINMAP_DIRECTION_SDR_TO_HDR
```

The gainmap will be applied as if the base image were SDR, and fully applying the gainmap
results in an HDR image.

<br />

Constant Value:

0
(0x00000000)


## Fields

### CREATOR

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<Gainmap> CREATOR
```

<br />

<br />

## Public constructors

### Gainmap

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Gainmap (Bitmap gainmapContents)
```

Creates a gainmap from a given Bitmap. The caller is responsible for setting the various
fields to the desired values. The defaults are as follows:

- Ratio min is 1f, 1f, 1f
- Ratio max is 2f, 2f, 2f
- Gamma is 1f, 1f, 1f
- Epsilon SDR is 0f, 0f, 0f
- Epsilon HDR is 0f, 0f, 0f
- Display ratio SDR is 1f
- Display ratio HDR is 2f

It is strongly recommended that at least the ratio max and display ratio HDR are adjusted to better suit the given gainmap contents.

<br />

<br />

| Parameters ||
|---|---|
| `gainmapContents` | `Bitmap`: This value cannot be `null`. <br /> |

### Gainmap

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Gainmap (Gainmap gainmap, 
                Bitmap gainmapContents)
```

Creates a new gainmap using the provided gainmap as the metadata source and the provided
bitmap as the replacement for the gainmapContents

<br />

| Parameters ||
|---|---|
| `gainmap` | `Gainmap`: This value cannot be `null`. <br /> |
| `gainmapContents` | `Bitmap`: This value cannot be `null`. <br /> |

## Public methods

### describeContents

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

No special parcel contents.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getAlternativeImagePrimaries

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorSpace getAlternativeImagePrimaries ()
```

Gets the colorspace that the gainmap math should be applied in.
Only the primaries are what is relevant for applying the gainmap. The transfer and range
characteritics are ignored.

If the returned ColorSpace is null, then applying the gainmap will be done using the color
gamut of the base image.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/ColorSpace` | <br /> |

### getDisplayRatioForFullHdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getDisplayRatioForFullHdr ()
```

Gets the hdr/sdr ratio at which point applying the gainmap results in an HDR rendition

<br />

| Returns ||
|---|---|
| `float` | This value cannot be `null`. <br /> |

### getEpsilonHdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getEpsilonHdr ()
```

Gets the hdr epsilon. For single-plane gainmaps, all 3 components should be the
same. The components are in r, g, b order.

<br />

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### getEpsilonSdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getEpsilonSdr ()
```

Gets the sdr epsilon. For single-plane gainmaps, all 3 components should be the
same. The components are in r, g, b order.

<br />

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### getGainmapContents

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bitmap getGainmapContents ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap` | Returns the image data of the gainmap represented as a Bitmap. This is represented as a Bitmap for broad API compatibility, however certain aspects of the Bitmap are ignored such as `https://developer.android.com/reference/android/graphics/Bitmap#getColorSpace()` or `https://developer.android.com/reference/android/graphics/Bitmap#getGainmap()` as they are not relevant to the gainmap's enhancement layer. This value cannot be `null`. <br /> |

### getGainmapDirection

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getGainmapDirection ()
```

Gets the direction that the gainmap math should be applied in.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_SDR_TO_HDR` - `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_HDR_TO_SDR` |

### getGamma

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getGamma ()
```

Gets the gainmap gamma. For single-plane gainmaps, all 3 components should be the
same. The components are in r, g, b order.

<br />

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### getMinDisplayRatioForHdrTransition

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getMinDisplayRatioForHdrTransition ()
```

Gets the hdr/sdr ratio below which applying the gainmap results in an SDR rendition.

<br />

| Returns ||
|---|---|
| `float` | This value cannot be `null`. <br /> |

### getRatioMax

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getRatioMax ()
```

Gets the gainmap ratio max. For single-plane gainmaps, all 3 components should be the
same. The components are in r, g, b order.

<br />

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### getRatioMin

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getRatioMin ()
```

Gets the gainmap ratio max. For single-plane gainmaps, all 3 components should be the
same. The components are in r, g, b order.

<br />

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### setAlternativeImagePrimaries

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAlternativeImagePrimaries (ColorSpace colorSpace)
```

Sets the colorspace that the gainmap math should be applied in.
Only the primaries are what is relevant for applying the gainmap. The transfer and range
characteritics are ignored.

If the supplied ColorSpace is null, then applying the gainmap will be done using the color
gamut of the base image.

<br />

| Parameters ||
|---|---|
| `colorSpace` | `ColorSpace`: This value may be `null`. <br /> |

### setDisplayRatioForFullHdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDisplayRatioForFullHdr (float max)
```

Sets the hdr/sdr ratio at which point applying the gainmap results in an HDR rendition.

<br />

| Parameters ||
|---|---|
| `max` | `float`: The hdr/sdr ratio at which point applying the gainmap results in an HDR rendition. Must be \>= 1.0f. Value is 1.0f or greater <br /> |

### setEpsilonHdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEpsilonHdr (float r, 
                float g, 
                float b)
```

Sets the hdr epsilon which is used to avoid numerical instability.
For single-plane gainmaps, r, g, and b should be the same.

<br />

| Parameters ||
|---|---|
| `r` | `float` <br /> |
| `g` | `float` <br /> |
| `b` | `float` <br /> |

### setEpsilonSdr

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEpsilonSdr (float r, 
                float g, 
                float b)
```

Sets the sdr epsilon which is used to avoid numerical instability.
For single-plane gainmaps, r, g, and b should be the same.

<br />

| Parameters ||
|---|---|
| `r` | `float` <br /> |
| `g` | `float` <br /> |
| `b` | `float` <br /> |

### setGainmapContents

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setGainmapContents (Bitmap bitmap)
```

Sets the image data of the gainmap. This is the 1 or 3 channel enhancement layer to apply
to the base image. This is represented as a Bitmap for broad API compatibility, however
certain aspects of the Bitmap are ignored such as `https://developer.android.com/reference/android/graphics/Bitmap#getColorSpace()` or
`https://developer.android.com/reference/android/graphics/Bitmap#getGainmap()` as they are not relevant to the gainmap's enhancement layer.

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap`: The non-null bitmap to set as the gainmap's contents <br /> |

### setGainmapDirection

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setGainmapDirection (int direction)
```

Sets the direction that the gainmap math should be applied in.

<br />

| Parameters ||
|---|---|
| `direction` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_SDR_TO_HDR` - `https://developer.android.com/reference/android/graphics/Gainmap#GAINMAP_DIRECTION_HDR_TO_SDR` |

### setGamma

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setGamma (float r, 
                float g, 
                float b)
```

Sets the gainmap gamma. For single-plane gainmaps, r, g, and b should be the same.

<br />

| Parameters ||
|---|---|
| `r` | `float` <br /> |
| `g` | `float` <br /> |
| `b` | `float` <br /> |

### setMinDisplayRatioForHdrTransition

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setMinDisplayRatioForHdrTransition (float min)
```

Sets the hdr/sdr ratio below which applying the gainmap results in an SDR rendition.

<br />

| Parameters ||
|---|---|
| `min` | `float`: The minimum hdr/sdr ratio at which point applying the gainmap results in an SDR rendition. Must be \>= 1.0f. Value is 1.0f or greater <br /> |

### setRatioMax

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setRatioMax (float r, 
                float g, 
                float b)
```

Sets the gainmap ratio max. For single-plane gainmaps, r, g, and b should be the same.

<br />

| Parameters ||
|---|---|
| `r` | `float` <br /> |
| `g` | `float` <br /> |
| `b` | `float` <br /> |

### setRatioMin

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setRatioMin (float r, 
                float g, 
                float b)
```

Sets the gainmap ratio min. For single-plane gainmaps, r, g, and b should be the same.

<br />

| Parameters ||
|---|---|
| `r` | `float` <br /> |
| `g` | `float` <br /> |
| `b` | `float` <br /> |

### writeToParcel

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Write the gainmap to the parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: Parcel object to write the gainmap data into. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. <br /> |