/** * @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(); }
/** * 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; }
/** * {@inheritDoc} */ protected function getImageIterator(ImageInterface $image) { return $image->getIterator(); }