define('QR_CACHEABLE',false);// use cache - more disk reads but less CPU power, masks and format templates are stored there
define('QR_CACHE_DIR',false);// used when QR_CACHEABLE === true
define('QR_LOG_DIR',false);// default error logs dir
define('QR_FIND_BEST_MASK',true);// if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
define('QR_FIND_FROM_RANDOM',2);// if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
define('QR_DEFAULT_MASK',2);// when QR_FIND_BEST_MASK === false
define('QR_PNG_MAXIMUM_SIZE',1024);// maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images
@param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.
public$version;///< __Integer__ QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.
public$width;///< __Integer__ Width of code table. Because code is square shaped - same as height.
@param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.
@param Boolean $autoInclude (optional) if __true__, required qrcanvas.js lib will be included (only once)
@return String containing JavaScript creating the code, Canvas element (when $elemId is __false__) and script tag with required lib (when $autoInclude is __true__ and not yet included)
$html.='<canvas id="'.$elemId.'" width="'.$width.'" height="'.$width.'">Your browser does not support CANVAS tag! Please upgrade to modern version of FireFox, Opera, Chrome or Safari/Webkit based browser</canvas>';
}
if($width!==false){
$extra.=', '.$width.', '.$width;
}
if($margin!==false){
$extra.=', '.$margin.', '.$margin;
}
$html.='<script>if(eval("typeof "+\'QRdrawCode\'+"==\'function\'")){QRdrawCode(QRdecompactOps(\''.$area->getCanvasOps().'\')'."\n".', \''.$elemId.'\', '.$area->getWidth().' '.$extra.');}else{alert(\'Please include qrcanvas.js!\');}</script>';
Encoder is used by QRCode to create simple static code generators. */
classQRencode{
public$casesensitive=true;///< __Boolean__ does input stream id case sensitive, if not encoder may use more optimal charsets
public$eightbit=false;///< __Boolean__ does input stream is 8 bit
public$version=0;///< __Integer__ code version (total size) if __0__ - will be auto-detected
public$size=3;///< __Integer__ pixel zoom factor, multiplier to map virtual code pixels to image output pixels
public$margin=4;///< __Integer__ margin (silent zone) size, in code pixels
public$structured=0;///< Structured QR codes. Not supported.
public$level=QR_ECLEVEL_L;///< __Integer__ error correction level __QR_ECLEVEL_L__, __QR_ECLEVEL_M__, __QR_ECLEVEL_Q__ or __QR_ECLEVEL_H__
public$hint=QR_MODE_8;///< __Integer__ encoding hint, __QR_MODE_8__ or __QR_MODE_KANJI__, Because Kanji encoding is kind of 8 bit encoding we need to hint encoder to use Kanji mode explicite. (otherwise it may try to encode it as plain 8 bit stream)
@param String $outfile (optional) output file name, if __false__ outputs to browser with required headers
@param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.