예제 #1
0
 protected function computeBucket(Color $_color)
 {
     if ($this->useGreyscale) {
         return ["grey" => (int) ($_color->getGrey() / $this->bucketQuantity)];
     }
     return ["red" => (int) ($_color->getRed() / $this->bucketQuantity), "green" => (int) ($_color->getGreen() / $this->bucketQuantity), "blue" => (int) ($_color->getBlue() / $this->bucketQuantity)];
 }
예제 #2
0
 protected function compareGreyPixels(Color $_a, Color $_b)
 {
     return pow($_a->getGrey() - $_b->getGrey(), 2);
 }
예제 #3
0
 protected function compareGreyPixels(Color $_a, Color $_b)
 {
     // jesli napotkalismy na rozne pixele - konczymy porownywanie obrazow
     $this->wasCompared = $_a->getGrey() !== $_b->getGrey();
 }
예제 #4
0
 protected function compareGreyPixels(Color $_a, Color $_b)
 {
     return (int) ($_a->getGrey() !== $_b->getGrey());
 }