Exemplo n.º 1
0
 /**
  * Load the color information of the requested pixel into the $colors array
  *
  * @since 2.0
  * @param SLIRImage $image
  * @param integer $x x-axis position of pixel to calculate
  * @param integer $y y-axis position of pixel to calculate
  * @return boolean
  */
 private function loadPixelInfo(SLIRImage $image, $x, $y)
 {
     if ($x < 0 || $x >= $image->getWidth() || $y < 0 || $y >= $image->getHeight()) {
         return false;
     }
     if (!isset($this->colors[$x])) {
         $this->colors[$x] = array();
     }
     if (!isset($this->colors[$x][$y])) {
         $this->colors[$x][$y] = array();
     }
     if (!isset($this->colors[$x][$y][self::PIXEL_INTERESTINGNESS]) && !isset($this->colors[$x][$y][self::PIXEL_LAB])) {
         $this->colors[$x][$y][self::PIXEL_LAB] = $this->evaluateColor(imagecolorat($image->getImage(), $x, $y));
     }
     return true;
 }