Exemplo n.º 1
0
 /**
  * @param ImageInterface $image
  */
 public function __construct(ImageInterface $image)
 {
     $this->image = $image->getImage();
     // init max limit
     $imgSize = $image->getSize();
     $this->xMax = $imgSize['width'];
     $this->yMax = $imgSize['height'];
 }
 /**
  * @param ImageInterface $image
  * @param string $randSeed 
  */
 public function __construct(ImageInterface $image, $randSeed)
 {
     $this->image = $image->getImage();
     $this->randSeed = $randSeed;
     $this->imgSize = $image->getSize();
     $this->setMaxLimit();
     $this->setCoordinates();
     // init rand
     $this->initRand();
 }
Exemplo n.º 3
0
 /**
  * Decode item
  * 
  * @param \Iterator         $coverTextIterator
  * @param ImageInterface    $stegoText
  * @return string
  */
 protected function decodeItem(\Iterator $coverTextIterator, ImageInterface $stegoText)
 {
     $pixelData = $coverTextIterator->current();
     $colorRgb = $stegoText->getBinaryColor($pixelData['color']);
     $channels = $this->getChannels($pixelData['x'], $pixelData['y']);
     $result = '';
     foreach ($channels as $item) {
         $result .= substr($colorRgb[$item], -1, 1);
     }
     return $result;
 }
Exemplo n.º 4
0
 /**
  * {@inheritDoc}
  */
 protected function getImageIterator(ImageInterface $image)
 {
     return $image->getIterator();
 }