Package com.google.zxing
Class ResultPoint
- java.lang.Object
-
- com.google.zxing.ResultPoint
-
- Direct Known Subclasses:
AlignmentPattern,FinderPattern
public class ResultPoint extends java.lang.ObjectEncapsulates a point of interest in an image containing a barcode. Typically, this would be the location of a finder pattern or the corner of the barcode, for example.
-
-
Constructor Summary
Constructors Constructor Description ResultPoint(float x, float y)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static floatcrossProductZ(ResultPoint pointA, ResultPoint pointB, ResultPoint pointC)Returns the z component of the cross product between vectors BC and BA.static floatdistance(ResultPoint pattern1, ResultPoint pattern2)booleanequals(java.lang.Object other)floatgetX()floatgetY()inthashCode()static voidorderBestPatterns(ResultPoint[] patterns)Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC and BC is less than AC, and the angle between BC and BA is less than 180 degrees.java.lang.StringtoString()
-
-
-
Method Detail
-
getX
public final float getX()
-
getY
public final float getY()
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
orderBestPatterns
public static void orderBestPatterns(ResultPoint[] patterns)
Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC and BC is less than AC, and the angle between BC and BA is less than 180 degrees.- Parameters:
patterns- array of threeResultPointto order
-
distance
public static float distance(ResultPoint pattern1, ResultPoint pattern2)
- Parameters:
pattern1- first patternpattern2- second pattern- Returns:
- distance between two points
-
crossProductZ
private static float crossProductZ(ResultPoint pointA, ResultPoint pointB, ResultPoint pointC)
Returns the z component of the cross product between vectors BC and BA.
-
-