void initializePatterns ( QrCode qr ) { int where [ ] = QrCode . VERSION_INFO [ qr . version ] . alignment ; qr . alignment . reset ( ) ; lookup . reset ( ) ; for ( int row = 0 ; row < where . length ; row ++ ) { for ( int col = 0 ; col < where . length ; col ++ ) { boolean skip = false ; if ( row == 0 && col == 0 ) skip = true ; else if ( row == 0 && col == where . length - 1 ) skip = true ; else if ( row == where . length - 1 && col == 0 ) skip = true ; if ( skip ) { lookup . add ( null ) ; } else { QrCode . Alignment a = qr . alignment . grow ( ) ; a . moduleX = where [ col ] ; a . moduleY = where [ row ] ; lookup . add ( a ) ; } } } }
Creates a list of alignment patterns to look for and their grid coordinates