import ResultPoint from '../../ResultPoint' ; author Sean Owen
  export default class AlignmentPattern extends ResultPoint { public constructor ( posX , posY , private estimatedModuleSize ) { super ( posX , posY ) ; } /**
     * <p>Determines if this alignment pattern "about equals" an alignment pattern at the stated
     * position and size -- meaning, it is at nearly the same center with nearly the same size.</p>
     */ public aboutEquals ( moduleSize , i , j ) { if ( Math . abs ( i - this . getY ( ) ) <= moduleSize && Math . abs ( j - this . getX ( ) ) <= moduleSize ) { const moduleSizeDiff = Math . abs ( moduleSize - this . estimatedModuleSize ) ; return moduleSizeDiff <= 1.0 || moduleSizeDiff <= this . estimatedModuleSize ; } return false ; } /**
     * Combines this object's current estimate of a finder pattern position and module size
     * with a new estimate. It returns a new {@code FinderPattern} containing an average of the two.
     */ public combineEstimate ( i , j , newModuleSize ) { const combinedX = ( this . getX ( ) + j ) / 2.0 ; const combinedY = ( this . getY ( ) + i ) / 2.0 ; const combinedModuleSize = ( this . estimatedModuleSize + newModuleSize ) / 2.0 ; return new AlignmentPattern ( combinedX , combinedY , combinedModuleSize ) ; } }