示例#1
0
 public function encodeModeStructure()
 {
     try {
         $bs = new QRbitstream();
         $bs->appendNum(4, 0x3);
         $bs->appendNum(4, ord($this->data[1]) - 1);
         $bs->appendNum(4, ord($this->data[0]) - 1);
         $bs->appendNum(8, ord($this->data[2]));
         $this->bstream = $bs;
         return 0;
     } catch (Exception $e) {
         return -1;
     }
 }
示例#2
0
 public function appendBytes($size, $data)
 {
     if ($size == 0) {
         return 0;
     }
     $b = QRbitstream::newFromBytes($size, $data);
     if (is_null($b)) {
         return -1;
     }
     $ret = $this->append($b);
     unset($b);
     return $ret;
 }
示例#3
0
 public function mergeBitStream()
 {
     if ($this->convertData() < 0) {
         return null;
     }
     $bstream = new QRbitstream();
     foreach ($this->items as $item) {
         $ret = $bstream->append($item->bstream);
         if ($ret < 0) {
             return null;
         }
     }
     return $bstream;
 }