break; case 4: list($R, $G, $B) = array($K, $M, $V); break; case 5: case 6: //for when $H=1 is given list($R, $G, $B) = array($V, $M, $N); break; } return array($R, $G, $B); } // QR code lib area finding $enc = QRencode::factory($eccLevel, 1, 0); $tab_src = $enc->encode($codeContents, false); $area = new QRarea($tab_src); $area->detectGroups(); $area->detectAreas(); // GD2 magical rendering $imgW = $area->width; $imgH = $area->width; $target_image = imagecreate(($imgW + $marginSize * 2) * $pixelPerPoint, ($imgH + $marginSize * 2) * $pixelPerPoint); $colBg = imagecolorallocate($target_image, 255, 255, 255); // BG, white $colTxt = imagecolorallocate($target_image, 0, 0, 0); // TXT, black $colPix = imagecolorallocate($target_image, 40, 40, 40); // Pixel $colRect = imagecolorallocate($target_image, 190, 190, 190); // Rect $colTracker = imagecolorallocate($target_image, 0, 220, 0);
<?php include '../lib/full/qrlib.php'; // debuging vector area finding module $codeContents = 'Let see what the code structure looks like with a little bit bigger code'; $eccLevel = QR_ECLEVEL_H; $enc = QRencode::factory($eccLevel, 1, 0); $tab_src = $enc->encode($codeContents, false); $area = new QRarea($tab_src); $area->detectGroups(); $area->detectAreas(); $area->dumpTab();
public function __construct($source_tab) { parent::__construct($source_tab); }
<?php include '../lib/full/qrlib.php'; // debuging vector area finding module, shape classification $codeContents = 'Let see what the code structure looks like with a little bit bigger code'; $eccLevel = QR_ECLEVEL_H; $enc = QRencode::factory($eccLevel, 1, 0); $tab_src = $enc->encode($codeContents, false); $area = new QRarea($tab_src); $area->detectGroups(); $area->detectAreas(); echo '<b style="color:red">red edged</b> - complex shapes<br/>'; echo '<b>without edge</b> - simple shapes (single pixels, rectangles, 3-pixel L shapes)<br/>'; $area->dumpEdges();