Lines Matching defs:frame

305 	protected $frame;
643 * Convert the frame in binary form
644 * @param $frame (array) array to binarize
645 * @return array frame in binary form
647 protected function binarize($frame) {
648 $len = count($frame);
649 // the frame is square (width = height)
650 foreach ($frame as &$frameLine) {
655 return $frame;
697 $this->frame = $this->newFrame($this->version);
722 $masked = $this->mask($this->width, $this->frame, $this->level);
724 $masked = $this->makeMask($this->width, $this->frame, (intval(self::QR_DEFAULT_MASK) % 8), $this->level);
727 $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level);
740 * Set frame value at specified position
745 $this->frame[$at['y']][$at['x']] = chr($val);
749 * Get frame value at specified position
754 return ord($this->frame[$at['y']][$at['x']]);
758 * Return the next frame position
804 } while(ord($this->frame[$y][$x]) & 0x80);
892 * Write Format Information on frame and returns the number of black bits
893 * @param $width (int) frame width
894 * @param $frame (array) frame
899 protected function writeFormatInformation($width, &$frame, $mask, $level) {
909 $frame[8][$width - 1 - $i] = chr($v);
911 $frame[$i][8] = chr($v);
913 $frame[$i + 1][8] = chr($v);
924 $frame[$width - 7 + $i][8] = chr($v);
926 $frame[8][7] = chr($v);
928 $frame[8][6 - $i] = chr($v);
1019 * @param $frame (array) frame
1022 protected function generateMaskNo($maskNo, $width, $frame) {
1026 if (ord($frame[$y][$x]) & 0x80) {
1068 * @param $frame (array)
1073 protected function makeMask($width, $frame, $maskNo, $level) {
1075 $this->makeMaskNo($maskNo, $width, $frame, $masked);
1113 * @param $frame (array)
1116 protected function evaluateSymbol($width, $frame) {
1122 $frameY = $frame[$y];
1124 $frameYM = $frame[$y-1];
1153 if (($y == 0) AND (ord($frame[$y][$x]) & 1)) {
1158 if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) {
1174 * @param $frame (array)
1178 protected function mask($width, $frame, $level) {
1191 $bestMask = $frame;
1196 $blacks = $this->makeMaskNo($i, $width, $frame, $mask);
2369 * @param $frame (array) frame
2372 * @return array frame
2374 protected function putAlignmentMarker($frame, $ox, $oy) {
2385 $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]);
2387 return $frame;
2393 * @param $frame (array) frame
2395 * @return array frame
2397 protected function putAlignmentPattern($version, $frame, $width) {
2399 return $frame;
2410 $frame = $this->putAlignmentMarker($frame, $x, $y);
2411 return $frame;
2416 $frame = $this->putAlignmentMarker($frame, 6, $cx);
2417 $frame = $this->putAlignmentMarker($frame, $cx, 6);
2424 $frame = $this->putAlignmentMarker($frame, $cx, $cy);
2429 return $frame;
2462 * @param $frame (array) frame
2465 * @return array frame
2467 protected function putFinderPattern($frame, $ox, $oy) {
2478 $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]);
2480 return $frame;
2484 * Return a copy of initialized frame.
2491 $frame = array_fill(0, $width, $frameLine);
2493 $frame = $this->putFinderPattern($frame, 0, 0);
2494 $frame = $this->putFinderPattern($frame, $width - 7, 0);
2495 $frame = $this->putFinderPattern($frame, 0, $width - 7);
2499 $frame[$y][7] = "\xc0";
2500 $frame[$y][$width - 8] = "\xc0";
2501 $frame[$yOffset][7] = "\xc0";
2505 $frame = $this->qrstrset($frame, 0, 7, $setPattern);
2506 $frame = $this->qrstrset($frame, $width-8, 7, $setPattern);
2507 $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern);
2510 $frame = $this->qrstrset($frame, 0, 8, $setPattern);
2511 $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8);
2514 $frame[$y][8] = "\x84";
2515 $frame[$yOffset][8] = "\x84";
2520 $frame[6][7+$i] = chr(0x90 | ($i & 1));
2521 $frame[7+$i][6] = chr(0x90 | ($i & 1));
2524 $frame = $this->putAlignmentPattern($version, $frame, $width);
2531 $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1));
2538 $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1));
2544 $frame[$width - 8][8] = "\x81";
2545 return $frame;
2549 * Set new frame for the specified version.