Example #1
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     $color = 0.21 * $pixel->red + 0.71 * $pixel->green + 0.07000000000000001 * $pixel->blue;
     $pixel->setColor($color, $color, $color);
     return $pixel;
 }
Example #2
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     $color = (max($pixel->getColor()) + min($pixel->getColor())) / 2;
     $pixel->setColor($color, $color, $color);
     return $pixel;
 }
Example #3
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     $color = $pixel->getAverage();
     $pixel->setColor($color, $color, $color);
     return $pixel;
 }
Example #4
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     if (!$this->percent || $pixel->getAverage() > 255 / (100 / $this->percent)) {
         $pixel->setColor(255, 255, 255);
     } else {
         $pixel->setColor();
     }
     return $pixel;
 }
Example #5
0
 public function getPixel($x, $y)
 {
     $newX = $x - $this->x;
     $newY = $y - $this->y;
     if (-1 < $newX && $newX < $this->getWidth() && -1 < $newY && $newY < $this->getHeight()) {
         return parent::getPixel($newX, $newY);
     } else {
         $pixel = parent::getPixel($x, $y);
         $pixel->disable();
         return $pixel;
     }
 }
Example #6
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     foreach ($this->lbms as $lbm) {
         if ($x >= $lbm->getWidth() || $y >= $lbm->getHeight()) {
             continue;
         }
         $top = $lbm->getPixel($x, $y);
         if ($top->isActive()) {
             return $this->blend->calculatePixel($top, $pixel);
         }
     }
     return $pixel;
 }
Example #7
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     foreach ($this->lbms as $lbm) {
         if ($x >= $lbm->getWidth() || $y >= $lbm->getHeight()) {
             continue;
         }
         $pixelDiff = $lbm->getPixel($x, $y);
         if (abs($pixel->red - $pixelDiff->red) < $this->difference && abs($pixel->green - $pixelDiff->green) < $this->difference && abs($pixel->blue - $pixelDiff->blue) < $this->difference) {
             $pixel->disable();
             break;
         }
     }
     return $pixel;
 }
Example #8
0
 public function getHeight()
 {
     return parent::getWidth();
 }
Example #9
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     $pixel->setColor(255 - $pixel->red, 255 - $pixel->green, 255 - $pixel->blue);
     return $pixel;
 }
Example #10
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     return $this->calculatePixel($pixel, $this->pixel);
 }
Example #11
0
 public function getPixel($x, $y)
 {
     return parent::getPixel($this->getWidth() - 1 - $x, $y);
 }
Example #12
0
 public function getPixel($x, $y)
 {
     return parent::getPixel($x, $this->getHeight() - 1 - $y);
 }