handlePossibleCenter(stateCount, i /*int*/, j /*int*/) {
        const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
        const centerJ = AlignmentPatternFinder.centerFromEnd(stateCount, j);
        const centerI = this.crossCheckVertical(i, /*(int) */ centerJ, 2 * stateCount[1], stateCountTotal);
        if (!isNaN(centerI)) {
            const estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0;
            for (const center of this.possibleCenters) {
                // Look for about the same center and module size:
                if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {
                    return center.combineEstimate(centerI, centerJ, estimatedModuleSize);
                }
            }
            // Hadn't found this before; save it
            const point = new AlignmentPattern(centerJ, centerI, estimatedModuleSize);
            this.possibleCenters.push(point);
            if (this.resultPointCallback !== null && this.resultPointCallback !== undefined) {
                this.resultPointCallback.foundPossibleResultPoint(point);
            }
        }
        return null;
    }
/**
     * <p>This is called when a horizontal scan finds a possible alignment pattern. It will
     * cross check with a vertical scan, and if successful, will see if this pattern had been
     * found on a previous horizontal scan. If so, we consider it confirmed and conclude we have
     * found the alignment pattern.</p>
     *
     * @param stateCount reading state module counts from horizontal scan
     * @param i row where alignment pattern may be found
     * @param j end of possible alignment pattern in row
     * @return {@link AlignmentPattern} if we have found the same pattern twice, or null if not
     */
This is called when a horizontal scan finds a possible alignment pattern. It will
cross check with a vertical scan, and if successful, will see if this pattern had been
found on a previous horizontal scan. If so, we consider it confirmed and conclude we have
found the alignment pattern.

@param stateCount reading state module counts from horizontal scan
@param i row where alignment pattern may be found
@param j end of possible alignment pattern in row
@return  AlignmentPattern if we have found the same pattern twice, or null if not
This is called when a horizontal scan finds a possible alignment pattern . It will cross check with a vertical scan and if successful will see if this pattern had been found on a previous horizontal scan . If so we consider it confirmed and conclude we have found the alignment pattern . @param stateCount reading state module counts from horizontal scan @param i row where alignment pattern may be found @param j end of possible alignment pattern in row @return AlignmentPattern if we have found the same pattern twice or null if not
handlePossibleCenter(stateCount, i , j ) {
        const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
        const centerJ = AlignmentPatternFinder.centerFromEnd(stateCount, j);
        const centerI = this.crossCheckVertical(i,  centerJ, 2 * stateCount[1], stateCountTotal);
        if (!isNaN(centerI)) {
            const estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0;
            for (const center of this.possibleCenters) {
                if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {
                    return center.combineEstimate(centerI, centerJ, estimatedModuleSize);
                }
            }
            const point = new AlignmentPattern(centerJ, centerI, estimatedModuleSize);
            this.possibleCenters.push(point);
            if (this.resultPointCallback !== null && this.resultPointCallback !== undefined) {
                this.resultPointCallback.foundPossibleResultPoint(point);
            }
        }
        return null;
    }
handlePossibleCenter ( stateCount , i , j ) { const stateCountTotal = stateCount [ 0 ] + stateCount [ 1 ] + stateCount [ 2 ] ; const centerJ = AlignmentPatternFinder . centerFromEnd ( stateCount , j ) ; const centerI = this . crossCheckVertical ( i , centerJ , 2 * stateCount [ 1 ] , stateCountTotal ) ; if ( ! isNaN ( centerI ) ) { const estimatedModuleSize = ( stateCount [ 0 ] + stateCount [ 1 ] + stateCount [ 2 ] ) / 3.0 ; for ( const center of this . possibleCenters ) { if ( center . aboutEquals ( estimatedModuleSize , centerI , centerJ ) ) { return center . combineEstimate ( centerI , centerJ , estimatedModuleSize ) ; } } const point = new AlignmentPattern ( centerJ , centerI , estimatedModuleSize ) ; this . possibleCenters . push ( point ) ; if ( this . resultPointCallback !== null && this . resultPointCallback !== undefined ) { this . resultPointCallback . foundPossibleResultPoint ( point ) ; } } return null ; }
<p>This is called when a horizontal scan finds a possible alignment pattern.
<p > This is called when a horizontal scan finds a possible alignment pattern .
/*int*/ /*int*/ /*(int) */ // Look for about the same center and module size: // Hadn't found this before; save it