demo/connections/third-party/qr/qr.js
function addAlignment(x, y) {
    var i;

    frameBuffer[x + width * y] = 1;

    for (i = -2; i < 2; i++) {
      frameBuffer[(x + i)     + width * (y - 2)]     = 1;
      frameBuffer[(x - 2)     + width * (y + i + 1)] = 1;
      frameBuffer[(x + 2)     + width * (y + i)]     = 1;
      frameBuffer[(x + i + 1) + width * (y + 2)]     = 1;
    }

    for (i = 0; i < 2; i++) {
      setMask(x - 1, y + i);
      setMask(x + 1, y - i);
      setMask(x - i, y - 1);
      setMask(x + i, y + 1);
    }
  }
function addAlignment(x, y) {
    var i;

    frameBuffer[x + width * y] = 1;

    for (i = -2; i < 2; i++) {
      frameBuffer[(x + i)     + width * (y - 2)]     = 1;
      frameBuffer[(x - 2)     + width * (y + i + 1)] = 1;
      frameBuffer[(x + 2)     + width * (y + i)]     = 1;
      frameBuffer[(x + i + 1) + width * (y + 2)]     = 1;
    }

    for (i = 0; i < 2; i++) {
      setMask(x - 1, y + i);
      setMask(x + 1, y - i);
      setMask(x - i, y - 1);
      setMask(x + i, y + 1);
    }
  }
function addAlignment ( x , y ) { var i ; frameBuffer [ x + width * y ] = 1 ; for ( i = - 2 ; i < 2 ; i ++ ) { frameBuffer [ ( x + i ) + width * ( y - 2 ) ] = 1 ; frameBuffer [ ( x - 2 ) + width * ( y + i + 1 ) ] = 1 ; frameBuffer [ ( x + 2 ) + width * ( y + i ) ] = 1 ; frameBuffer [ ( x + i + 1 ) + width * ( y + 2 ) ] = 1 ; } for ( i = 0 ; i < 2 ; i ++ ) { setMask ( x - 1 , y + i ) ; setMask ( x + 1 , y - i ) ; setMask ( x - i , y - 1 ) ; setMask ( x + i , y + 1 ) ; } }
Enter alignment pattern. Foreground colour to frame, background to mask. Frame will be merged with mask later.
Enter alignment pattern . Foreground colour to frame background to mask . Frame will be merged with mask later .