Added in API level 28

OisSample


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

Immutable class to store an optical image stabilization sample.

Summary

Public constructors
OisSample(timestamp: Long, xShift: Float, yShift: Float)

Create a new OisSample.

Public methods
Boolean
equals(other: Any?)

Check if this OisSample is equal to another OisSample.

Long

Get the timestamp in nanoseconds.

Float

Get the shift in x direction.

Float

Get the shift in y direction.

Int

Returns a hash code value for the object.

String

Return the OisSample as a string representation.

Public constructors

OisSample

Added in API level 28
OisSample(
    timestamp: Long,
    xShift: Float,
    yShift: Float)

Create a new OisSample.

OisSample contains the timestamp and the amount of shifts in x and y direction, in pixels, of the OIS sample.

A positive value for a shift in x direction is a shift from left to right in active array coordinate system. For example, if the optical center is (1000, 500) in active array coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).

A positive value for a shift in y direction is a shift from top to bottom in active array coordinate system. For example, if the optical center is (1000, 500) in active array coordinates, a shift of (0, 5) puts the new optical center at (1000, 505).

xShift and yShift must be finite; NaN and infinity is not allowed.

Parameters
timestamp Long: timestamp of the OIS sample.
xShift Float: shift of the OIS sample in x direction.
yShift Float: shift of the OIS sample in y direction.
Exceptions
java.lang.IllegalArgumentException if xShift or yShift is not finite

Public methods

equals

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

Check if this OisSample is equal to another OisSample.

Two samples are only equal if and only if each of the OIS information is equal.

Parameters
obj the reference object with which to compare.
Return
Boolean true if the objects were equal, false otherwise

getTimestamp

Added in API level 28
fun getTimestamp(): Long

Get the timestamp in nanoseconds.

The timestamps are in the same timebase as and comparable to android.sensor.timestamp.

Return
Long a long value (guaranteed to be finite)

getXshift

Added in API level 28
fun getXshift(): Float

Get the shift in x direction.

Return
Float a floating point value (guaranteed to be finite)

getYshift

Added in API level 28
fun getYshift(): Float

Get the shift in y direction.

Return
Float a floating point value (guaranteed to be finite)

hashCode

Added in API level 28
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 28
fun toString(): String

Return the OisSample as a string representation.

"OisSample{timestamp:%l, shift_x:%f, shift_y:%f}" represents the OIS sample's timestamp, shift in x direction, and shift in y direction.

Return
String string representation of OisSample