| @@ 131-141 (lines=11) @@ | ||
| 128 | /** |
|
| 129 | * {@inheritdoc} |
|
| 130 | */ |
|
| 131 | public function withType($type) |
|
| 132 | { |
|
| 133 | if (!isset(static::$typeMapping[$type])) { |
|
| 134 | throw new RuntimeException('Unsupported image type'); |
|
| 135 | } |
|
| 136 | ||
| 137 | $image = clone $this; |
|
| 138 | $image->gmagick->setimagetype(static::$typeMapping[$type]); |
|
| 139 | ||
| 140 | return $image; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * {@inheritdoc} |
|
| @@ 167-177 (lines=11) @@ | ||
| 164 | /** |
|
| 165 | * {@inheritdoc} |
|
| 166 | */ |
|
| 167 | public function withColorSpace($colorSpace) |
|
| 168 | { |
|
| 169 | if (!isset(static::$colorSpaceMapping[$colorSpace])) { |
|
| 170 | throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported'); |
|
| 171 | } |
|
| 172 | ||
| 173 | $image = clone $this; |
|
| 174 | $image->gmagick->setimagecolorspace(static::$colorSpaceMapping[$colorSpace]); |
|
| 175 | ||
| 176 | return $image; |
|
| 177 | } |
|
| 178 | ||
| 179 | /** |
|
| 180 | * {@inheritdoc} |
|
| @@ 134-144 (lines=11) @@ | ||
| 131 | /** |
|
| 132 | * {@inheritdoc} |
|
| 133 | */ |
|
| 134 | public function withType($type) |
|
| 135 | { |
|
| 136 | if (!isset(static::$typeMapping[$type])) { |
|
| 137 | throw new RuntimeException('Unsupported image type'); |
|
| 138 | } |
|
| 139 | ||
| 140 | $image = clone $this; |
|
| 141 | $image->imagick->setImageType(static::$typeMapping[$type]); |
|
| 142 | ||
| 143 | return $image; |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * {@inheritdoc} |
|
| @@ 167-177 (lines=11) @@ | ||
| 164 | /** |
|
| 165 | * {@inheritdoc} |
|
| 166 | */ |
|
| 167 | public function withColorSpace($colorSpace) |
|
| 168 | { |
|
| 169 | if (!isset(static::$colorSpaceMapping[$colorSpace])) { |
|
| 170 | throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported'); |
|
| 171 | } |
|
| 172 | ||
| 173 | $image = clone $this; |
|
| 174 | $image->imagick->setImageColorspace(static::$colorSpaceMapping[$colorSpace]); |
|
| 175 | ||
| 176 | return $image; |
|
| 177 | } |
|
| 178 | ||
| 179 | /** |
|
| 180 | * {@inheritdoc} |
|