Android APIs
public final class

LensShadingMap

extends Object
java.lang.Object
   ↳ android.hardware.camera2.params.LensShadingMap

Class Overview

Immutable class for describing a 4 x N x M lens shading map of floats.

Summary

Constants
float MINIMUM_GAIN_FACTOR The smallest gain factor in this map.
Public Methods
void copyGainFactors(float[] destination, int offset)
Copy all gain factors in row-major order from this lens shading map into the destination.
boolean equals(Object obj)
Check if this LensShadingMap is equal to another LensShadingMap.
int getColumnCount()
Get the number of columns in this map.
float getGainFactor(int colorChannel, int column, int row)
Get a single color channel gain factor from this lens shading map by its row and column.
int getGainFactorCount()
Get the total number of gain factors in this map.
RggbChannelVector getGainFactorVector(int column, int row)
Get a gain factor vector from this lens shading map by its row and column.
int getRowCount()
Get the number of rows in this map.
int hashCode()
Returns an integer hash code for this object.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final float MINIMUM_GAIN_FACTOR

Added in API level 21

The smallest gain factor in this map.

All values in this map will be at least this large.

Constant Value: 1.0

Public Methods

public void copyGainFactors (float[] destination, int offset)

Added in API level 21

Copy all gain factors in row-major order from this lens shading map into the destination.

Each gain factor will be >= MINIMUM_GAIN_FACTOR.

Parameters
destination an array big enough to hold at least COUNT elements after the offset
offset a non-negative offset into the array
Throws
NullPointerException If destination was null
IllegalArgumentException If offset was negative
ArrayIndexOutOfBoundsException If there's not enough room to write the elements at the specified destination and offset.

public boolean equals (Object obj)

Added in API level 21

Check if this LensShadingMap is equal to another LensShadingMap.

Two lens shading maps are equal if and only if they have the same rows/columns, and all of their elements are equal.

Parameters
obj the object to compare this instance with.
Returns
  • true if the objects were equal, false otherwise

public int getColumnCount ()

Added in API level 21

Get the number of columns in this map.

public float getGainFactor (int colorChannel, int column, int row)

Added in API level 21

Get a single color channel gain factor from this lens shading map by its row and column.

The rows must be within the range [0, getRowCount()), the column must be within the range [0, getColumnCount()), and the color channel must be within the range [0, RggbChannelVector.COUNT).

The channel order is [R, Geven, Godd, B], where Geven is the green channel for the even rows of a Bayer pattern, and Godd is the odd rows.

Parameters
colorChannel color channel from [R, Geven, Godd, B]
column within the range [0, getColumnCount())
row within the range [0, getRowCount())
Returns
Throws
IllegalArgumentException if any of the parameters was out of range

public int getGainFactorCount ()

Added in API level 21

Get the total number of gain factors in this map.

A single gain factor contains exactly one color channel. Use with copyGainFactors(float[], int) to allocate a large-enough array.

public RggbChannelVector getGainFactorVector (int column, int row)

Added in API level 21

Get a gain factor vector from this lens shading map by its row and column.

The rows must be within the range [0, getRowCount()), the column must be within the range [0, getColumnCount()).

Parameters
column within the range [0, getColumnCount())
row within the range [0, getRowCount())
Returns
Throws
IllegalArgumentException if any of the parameters was out of range

public int getRowCount ()

Added in API level 21

Get the number of rows in this map.

public int hashCode ()

Added in API level 21

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.