Lines Matching refs:size
112 list($size, $mtx) = $this->qr_create_matrix($vers, $data);
113 list($mask, $mtx) = $this->qr_apply_best_mask($mtx, $size);
114 $mtx = $this->qr_finalize_matrix($mtx, $size, $ecl, $mask, $vers);
118 's' => array($size, $size),
476 $size = $version * 4 + 17;
478 for ($i = 0; $i < $size; $i++) {
480 for ($j = 0; $j < $size; $j++) {
492 $matrix[$size - $i - 1][$j] = $m;
493 $matrix[$i][$size - $j - 1] = $m;
513 for ($i = $size - 9; $i >= 8; $i--) {
518 $matrix[$size - 8][8] = 3;
523 if ($i && !$matrix[$size - $i][8]) $matrix[$size - $i][8] = 1;
524 if ($i && !$matrix[8][$size - $i]) $matrix[8][$size - $i] = 1;
530 $matrix[$size - $i][$j] = 1;
531 $matrix[$j][$size - $i] = 1;
536 $col = $size - 1;
537 $row = $size - 1;
551 if ($row < 0 || $row >= $size) {
558 return array($size, $matrix);
561 protected function qr_apply_best_mask($matrix, $size) argument
564 $best_matrix = $this->qr_apply_mask($matrix, $size, $best_mask);
565 $best_penalty = $this->qr_penalty($best_matrix, $size);
567 $test_matrix = $this->qr_apply_mask($matrix, $size, $test_mask);
568 $test_penalty = $this->qr_penalty($test_matrix, $size);
578 protected function qr_apply_mask($matrix, $size, $mask) argument
580 for ($i = 0; $i < $size; $i++) {
581 for ($j = 0; $j < $size; $j++) {
614 protected function qr_penalty(&$matrix, $size) argument
616 $score = $this->qr_penalty_1($matrix, $size);
617 $score += $this->qr_penalty_2($matrix, $size);
618 $score += $this->qr_penalty_3($matrix, $size);
619 $score += $this->qr_penalty_4($matrix, $size);
623 protected function qr_penalty_1(&$matrix, $size) argument
626 for ($i = 0; $i < $size; $i++) {
631 for ($j = 0; $j < $size; $j++) {
655 protected function qr_penalty_2(&$matrix, $size) argument
658 for ($i = 1; $i < $size; $i++) {
659 for ($j = 1; $j < $size; $j++) {
674 protected function qr_penalty_3(&$matrix, $size) argument
677 for ($i = 0; $i < $size; $i++) {
688 for ($j = 11; $j < $size; $j++) {
700 protected function qr_penalty_4(&$matrix, $size) argument
703 for ($i = 0; $i < $size; $i++) {
704 for ($j = 0; $j < $size; $j++) {
711 $dark /= $size * $size;
718 $matrix, $size, $ecl, $mask, $version argument
738 $matrix[$size - 1][8] = $format[0];
739 $matrix[$size - 2][8] = $format[1];
740 $matrix[$size - 3][8] = $format[2];
741 $matrix[$size - 4][8] = $format[3];
742 $matrix[$size - 5][8] = $format[4];
743 $matrix[$size - 6][8] = $format[5];
744 $matrix[$size - 7][8] = $format[6];
745 $matrix[8][$size - 8] = $format[7];
746 $matrix[8][$size - 7] = $format[8];
747 $matrix[8][$size - 6] = $format[9];
748 $matrix[8][$size - 5] = $format[10];
749 $matrix[8][$size - 4] = $format[11];
750 $matrix[8][$size - 3] = $format[12];
751 $matrix[8][$size - 2] = $format[13];
752 $matrix[8][$size - 1] = $format[14];
757 $r = $size - 9 - ($i % 3);
764 for ($i = 0; $i < $size; $i++) {
765 for ($j = 0; $j < $size; $j++) {