示例#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;
 }
示例#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;
 }
示例#3
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     $color = $pixel->getAverage();
     $pixel->setColor($color, $color, $color);
     return $pixel;
 }
示例#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;
 }
示例#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;
     }
 }
示例#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;
 }
示例#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;
 }
示例#8
0
 public function getHeight()
 {
     return parent::getWidth();
 }
示例#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;
 }
示例#10
0
 public function getPixel($x, $y)
 {
     $pixel = parent::getPixel($x, $y);
     return $this->calculatePixel($pixel, $this->pixel);
 }
示例#11
0
 public function getPixel($x, $y)
 {
     return parent::getPixel($this->getWidth() - 1 - $x, $y);
 }
示例#12
0
 public function getPixel($x, $y)
 {
     return parent::getPixel($x, $this->getHeight() - 1 - $y);
 }