| @@ 95-105 (lines=11) @@ | ||
| 92 | /** |
|
| 93 | * {@inheritdoc} |
|
| 94 | */ |
|
| 95 | public function withType($type) |
|
| 96 | { |
|
| 97 | if (!isset(static::$typeMapping[$type])) { |
|
| 98 | throw new RuntimeException('Unsupported image type'); |
|
| 99 | } |
|
| 100 | ||
| 101 | $image = clone $this; |
|
| 102 | $image->gmagick->setimagetype(static::$typeMapping[$type]); |
|
| 103 | ||
| 104 | return $image; |
|
| 105 | } |
|
| 106 | ||
| 107 | /** |
|
| 108 | * {@inheritdoc} |
|
| @@ 128-138 (lines=11) @@ | ||
| 125 | /** |
|
| 126 | * {@inheritdoc} |
|
| 127 | */ |
|
| 128 | public function withColorSpace($colorSpace) |
|
| 129 | { |
|
| 130 | if (!isset(static::$colorSpaceMapping[$colorSpace])) { |
|
| 131 | throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported'); |
|
| 132 | } |
|
| 133 | ||
| 134 | $image = clone $this; |
|
| 135 | $image->gmagick->setimagecolorspace(static::$colorSpaceMapping[$colorSpace]); |
|
| 136 | ||
| 137 | return $image; |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * {@inheritdoc} |
|
| @@ 96-106 (lines=11) @@ | ||
| 93 | /** |
|
| 94 | * {@inheritdoc} |
|
| 95 | */ |
|
| 96 | public function withType($type) |
|
| 97 | { |
|
| 98 | if (!isset(static::$typeMapping[$type])) { |
|
| 99 | throw new RuntimeException('Unsupported image type'); |
|
| 100 | } |
|
| 101 | ||
| 102 | $image = clone $this; |
|
| 103 | $image->imagick->setImageType(static::$typeMapping[$type]); |
|
| 104 | ||
| 105 | return $image; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * {@inheritdoc} |
|
| @@ 129-139 (lines=11) @@ | ||
| 126 | /** |
|
| 127 | * {@inheritdoc} |
|
| 128 | */ |
|
| 129 | public function withColorSpace($colorSpace) |
|
| 130 | { |
|
| 131 | if (!isset(static::$colorSpaceMapping[$colorSpace])) { |
|
| 132 | throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported'); |
|
| 133 | } |
|
| 134 | ||
| 135 | $image = clone $this; |
|
| 136 | $image->imagick->setImageColorspace(static::$colorSpaceMapping[$colorSpace]); |
|
| 137 | ||
| 138 | return $image; |
|
| 139 | } |
|
| 140 | ||
| 141 | /** |
|
| 142 | * {@inheritdoc} |
|