# Print output for @column tags ?>
public
final
class
OisSample
extends Object
java.lang.Object | |
↳ | android.hardware.camera2.params.OisSample |
Immutable class to store an
optical image stabilization sample
.
Public constructors | |
---|---|
OisSample(long timestamp, float xShift, float yShift)
Create a new |
Public methods | |
---|---|
boolean
|
equals(Object obj)
|
long
|
getTimestamp()
Get the timestamp in nanoseconds. |
float
|
getXshift()
Get the shift in x direction. |
float
|
getYshift()
Get the shift in y direction. |
int
|
hashCode()
Returns a hash code value for the object. |
String
|
toString()
Return the OisSample as a string representation. |
Inherited methods | |
---|---|
public OisSample (long timestamp, float xShift, float yShift)
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. |
Throws | |
---|---|
IllegalArgumentException |
if xShift or yShift is not finite |
public boolean equals (Object obj)
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 |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if the objects were equal, false otherwise |
public long getTimestamp ()
Get the timestamp in nanoseconds.
The timestamps are in the same timebase as and comparable to
android.sensor.timestamp
.
Returns | |
---|---|
long |
a long value (guaranteed to be finite) |
public float getXshift ()
Get the shift in x direction.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
public float getYshift ()
Get the shift in y direction.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
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.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
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.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |