*
* @author Sean Owen
*/
-public final class FinderPattern implements ResultPoint {
+public final class FinderPattern extends ResultPoint {
- private final float posX;
- private final float posY;
private final float estimatedModuleSize;
private int count;
FinderPattern(float posX, float posY, float estimatedModuleSize) {
- this.posX = posX;
- this.posY = posY;
+ super(posX, posY);
this.estimatedModuleSize = estimatedModuleSize;
this.count = 1;
}
- public float getX() {
- return posX;
- }
-
- public float getY() {
- return posY;
- }
-
- float getEstimatedModuleSize() {
+ public float getEstimatedModuleSize() {
return estimatedModuleSize;
}
* position and size -- meaning, it is at nearly the same center with nearly the same size.</p>
*/
boolean aboutEquals(float moduleSize, float i, float j) {
- if (Math.abs(i - posY) <= moduleSize && Math.abs(j - posX) <= moduleSize) {
+ if (Math.abs(i - getY()) <= moduleSize && Math.abs(j - getX()) <= moduleSize) {
float moduleSizeDiff = Math.abs(moduleSize - estimatedModuleSize);
return moduleSizeDiff <= 1.0f || moduleSizeDiff / estimatedModuleSize <= 1.0f;
}