| @@ 114-125 (lines=12) @@ | ||
| 111 | * |
|
| 112 | * @return Difference |
|
| 113 | */ |
|
| 114 | public function difference(Image $image, callable $method) |
|
| 115 | { |
|
| 116 | $transformation = new Transformation\Difference(); |
|
| 117 | ||
| 118 | $bitmap = $transformation( |
|
| 119 | $this->bitmap, $image->bitmap, $this->width, $this->height, $method |
|
| 120 | ); |
|
| 121 | ||
| 122 | return new Difference( |
|
| 123 | $this->cloneWith("bitmap", $bitmap) |
|
| 124 | ); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * @param string $property |
|
| @@ 66-76 (lines=11) @@ | ||
| 63 | * |
|
| 64 | * @return Difference |
|
| 65 | */ |
|
| 66 | public function withScale($factor) |
|
| 67 | { |
|
| 68 | $maximum = $this->maximum(); |
|
| 69 | $transformation = new Transformation\Scale(); |
|
| 70 | ||
| 71 | $bitmap = $transformation( |
|
| 72 | $this->bitmap, $this->width, $this->height, $maximum, $factor |
|
| 73 | ); |
|
| 74 | ||
| 75 | return $this->cloneWith("bitmap", $bitmap); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * Maximum difference for all bitmap pixels. |
|
| @@ 97-107 (lines=11) @@ | ||
| 94 | * |
|
| 95 | * @return Difference |
|
| 96 | */ |
|
| 97 | public function withReducedStandardDeviation() |
|
| 98 | { |
|
| 99 | $deviation = $this->standardDeviation(); |
|
| 100 | $transformation = new Transformation\ReducedStandardDeviation(); |
|
| 101 | ||
| 102 | $bitmap = $transformation( |
|
| 103 | $this->bitmap, $this->width, $this->height, $deviation |
|
| 104 | ); |
|
| 105 | ||
| 106 | return $this->cloneWith("bitmap", $bitmap); |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| 110 | * Standard deviation for all bitmap pixels. |
|