Added in API level 21

LensShadingMap


class LensShadingMap
kotlin.Any
   ↳ android.hardware.camera2.params.LensShadingMap

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

Summary

Constants
static Float

The smallest gain factor in this map.

Public methods
Unit
copyGainFactors(destination: FloatArray!, offset: Int)

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

Boolean
equals(other: Any?)

Check if this LensShadingMap is equal to another LensShadingMap.

Int

Get the number of columns in this map.

Float
getGainFactor(colorChannel: Int, column: Int, row: Int)

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

Int

Get the total number of gain factors in this map.

RggbChannelVector!
getGainFactorVector(column: Int, row: Int)

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

Int

Get the number of rows in this map.

Int

Returns a hash code value for the object.

String

Return the LensShadingMap as a string representation.

Constants

MINIMUM_GAIN_FACTOR

Added in API level 21
static val MINIMUM_GAIN_FACTOR: Float

The smallest gain factor in this map.

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

Value: 1.0f

Public methods

copyGainFactors

Added in API level 21
fun copyGainFactors(
    destination: FloatArray!,
    offset: Int
): Unit

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 FloatArray!: an array big enough to hold at least RggbChannelVector#COUNT elements after the offset
offset Int: a non-negative offset into the array
Exceptions
java.lang.NullPointerException If destination was null
java.lang.IllegalArgumentException If offset was negative
java.lang.ArrayIndexOutOfBoundsException If there's not enough room to write the elements at the specified destination and offset.

equals

Added in API level 21
fun equals(other: Any?): Boolean

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 reference object with which to compare.
Return
Boolean true if the objects were equal, false otherwise

getColumnCount

Added in API level 21
fun getColumnCount(): Int

Get the number of columns in this map.

getGainFactor

Added in API level 21
fun getGainFactor(
    colorChannel: Int,
    column: Int,
    row: Int
): Float

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, {@value android.hardware.camera2.params.RggbChannelVector#COUNT 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 Int: color channel from [R, Geven, Godd, B]
column Int: within the range [0, getColumnCount)
row Int: within the range [0, getRowCount)
Return
Float a gain factor >= {@value #MINIMUM_GAIN_FACTOR}
Exceptions
java.lang.IllegalArgumentException if any of the parameters was out of range

getGainFactorCount

Added in API level 21
fun getGainFactorCount(): Int

Get the total number of gain factors in this map.

A single gain factor contains exactly one color channel. Use with copyGainFactors to allocate a large-enough array.

getGainFactorVector

Added in API level 21
fun getGainFactorVector(
    column: Int,
    row: Int
): RggbChannelVector!

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 Int: within the range [0, getColumnCount)
row Int: within the range [0, getRowCount)
Return
RggbChannelVector! an RggbChannelVector where each gain factor >= {@value #MINIMUM_GAIN_FACTOR}
Exceptions
java.lang.IllegalArgumentException if any of the parameters was out of range

getRowCount

Added in API level 21
fun getRowCount(): Int

Get the number of rows in this map.

hashCode

Added in API level 21
fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.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.
Return
Int a hash code value for this object.

toString

Added in API level 21
fun toString(): String

Return the LensShadingMap as a string representation.

"LensShadingMap{R:([%f, %f, ... %f], ... [%f, %f, ... %f]), G_even:([%f, %f, ... %f], ... [%f, %f, ... %f]), G_odd:([%f, %f, ... %f], ... [%f, %f, ... %f]), B:([%f, %f, ... %f], ... [%f, %f, ... %f])}", where each %f represents one gain factor and each [%f, %f, ... %f] represents a row of the lens shading map

Return
String string representation of LensShadingMap