static maybeEmbedPositionAdjustmentPatterns(version, matrix) {
        if (version.getVersionNumber() < 2) { // The patterns appear if version >= 2
            return;
        }
        const index = version.getVersionNumber() - 1;
        const coordinates = MatrixUtil.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index];
        for (let i = 0, length = coordinates.length; i !== length; i++) {
            const y = coordinates[i];
            if (y >= 0) {
                for (let j = 0; j !== length; j++) {
                    const x = coordinates[j];
                    if (x >= 0 && MatrixUtil.isEmpty(matrix.get(x, y))) {
                        // If the cell is unset, we embed the position adjustment pattern here.
                        // -2 is necessary since the x/y coordinates point to the center of the pattern, not the
                        // left top corner.
                        MatrixUtil.embedPositionAdjustmentPattern(x - 2, y - 2, matrix);
                    }
                }
            }
        }
    }
// Embed position adjustment patterns if need be.
Embed position adjustment patterns if need be.
Embed position adjustment patterns if need be .
static maybeEmbedPositionAdjustmentPatterns(version, matrix) {
        if (version.getVersionNumber() < 2) { 
            return;
        }
        const index = version.getVersionNumber() - 1;
        const coordinates = MatrixUtil.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index];
        for (let i = 0, length = coordinates.length; i !== length; i++) {
            const y = coordinates[i];
            if (y >= 0) {
                for (let j = 0; j !== length; j++) {
                    const x = coordinates[j];
                    if (x >= 0 && MatrixUtil.isEmpty(matrix.get(x, y))) {
                        MatrixUtil.embedPositionAdjustmentPattern(x - 2, y - 2, matrix);
                    }
                }
            }
        }
    }
static maybeEmbedPositionAdjustmentPatterns ( version , matrix ) { if ( version . getVersionNumber ( ) < 2 ) { return ; } const index = version . getVersionNumber ( ) - 1 ; const coordinates = MatrixUtil . POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE [ index ] ; for ( let i = 0 , length = coordinates . length ; i !== length ; i ++ ) { const y = coordinates [ i ] ; if ( y >= 0 ) { for ( let j = 0 ; j !== length ; j ++ ) { const x = coordinates [ j ] ; if ( x >= 0 && MatrixUtil . isEmpty ( matrix . get ( x , y ) ) ) { MatrixUtil . embedPositionAdjustmentPattern ( x - 2 , y - 2 , matrix ) ; } } } } }
Embed position adjustment patterns if need be.
Embed position adjustment patterns if need be .
// The patterns appear if version >= 2 // If the cell is unset, we embed the position adjustment pattern here. // -2 is necessary since the x/y coordinates point to the center of the pattern, not the // left top corner.