render()
render(\BaconQrCode\Encoder\QrCode $qrCode) : string
Renders a QR code.
Parameters
\BaconQrCode\Encoder\QrCode | $qrCode |
Renderer interface.
render(\BaconQrCode\Encoder\QrCode $qrCode) : string
Renders a QR code.
\BaconQrCode\Encoder\QrCode | $qrCode |
addColor(string $id, \BaconQrCode\Renderer\Color\ColorInterface $color) : void
Adds a color to the drawing area.
string | $id | |
\BaconQrCode\Renderer\Color\ColorInterface | $color |
<?php
/**
* BaconQrCode
*
* @link http://github.com/Bacon/BaconQrCode For the canonical source repository
* @copyright 2013 Ben 'DASPRiD' Scholzen
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
*/
namespace BaconQrCode\Renderer\Image;
use BaconQrCode\Renderer\Color\ColorInterface;
use BaconQrCode\Renderer\RendererInterface as GeneralRendererInterface;
/**
* Renderer interface.
*/
interface RendererInterface extends GeneralRendererInterface
{
/**
* Initiates the drawing area.
*
* @return void
*/
public function init();
/**
* Adds a color to the drawing area.
*
* @param string $id
* @param ColorInterface $color
* @return void
*/
public function addColor($id, ColorInterface $color);
/**
* Draws the background.
*
* @param string $colorId
* @return void
*/
public function drawBackground($colorId);
/**
* Draws a block at a specified position.
*
* @param integer $x
* @param integer $y
* @param string $colorId
* @return void
*/
public function drawBlock($x, $y, $colorId);
/**
* Returns the byte stream representing the QR code.
*
* @return string
*/
public function getByteStream();
}