| @@ 18-53 (lines=36) @@ | ||
| 15 | * |
|
| 16 | * @package GravityMedia\Magickly\Image\Palette |
|
| 17 | */ |
|
| 18 | class CMYK implements PaletteInterface |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var null|ColorProfile |
|
| 22 | */ |
|
| 23 | protected $colorProfile; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * {@inheritdoc} |
|
| 27 | */ |
|
| 28 | public function getColorSpace() |
|
| 29 | { |
|
| 30 | return ColorSpace::COLOR_SPACE_CMYK; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * {@inheritdoc} |
|
| 35 | */ |
|
| 36 | public function getColorProfile() |
|
| 37 | { |
|
| 38 | if (null === $this->colorProfile) { |
|
| 39 | $this->colorProfile = ColorProfile::fromPath(__DIR__ . '/../../../resources/USWebUncoated.icc'); |
|
| 40 | } |
|
| 41 | ||
| 42 | return $this->colorProfile; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function setColorProfile(ColorProfile $iccProfile) |
|
| 49 | { |
|
| 50 | $this->colorProfile = $iccProfile; |
|
| 51 | return $this; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 18-53 (lines=36) @@ | ||
| 15 | * |
|
| 16 | * @package GravityMedia\Magickly\Image\Palette |
|
| 17 | */ |
|
| 18 | class Grayscale implements PaletteInterface |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var null|ColorProfile |
|
| 22 | */ |
|
| 23 | protected $colorProfile; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * {@inheritdoc} |
|
| 27 | */ |
|
| 28 | public function getColorSpace() |
|
| 29 | { |
|
| 30 | return ColorSpace::COLOR_SPACE_GRAYSCALE; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * {@inheritdoc} |
|
| 35 | */ |
|
| 36 | public function getColorProfile() |
|
| 37 | { |
|
| 38 | if (null === $this->colorProfile) { |
|
| 39 | $this->colorProfile = ColorProfile::fromPath(__DIR__ . '/../../../resources/Dot_Gain_15.icc'); |
|
| 40 | } |
|
| 41 | ||
| 42 | return $this->colorProfile; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function setColorProfile(ColorProfile $iccProfile) |
|
| 49 | { |
|
| 50 | $this->colorProfile = $iccProfile; |
|
| 51 | return $this; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 18-53 (lines=36) @@ | ||
| 15 | * |
|
| 16 | * @package GravityMedia\Magickly\Image\Palette |
|
| 17 | */ |
|
| 18 | class RGB implements PaletteInterface |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var null|ColorProfile |
|
| 22 | */ |
|
| 23 | protected $colorProfile; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * {@inheritdoc} |
|
| 27 | */ |
|
| 28 | public function getColorSpace() |
|
| 29 | { |
|
| 30 | return ColorSpace::COLOR_SPACE_RGB; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * {@inheritdoc} |
|
| 35 | */ |
|
| 36 | public function getColorProfile() |
|
| 37 | { |
|
| 38 | if (null === $this->colorProfile) { |
|
| 39 | $this->colorProfile = ColorProfile::fromPath(__DIR__ . '/../../../resources/sRGB_IEC61966-2-1.icc'); |
|
| 40 | } |
|
| 41 | ||
| 42 | return $this->colorProfile; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function setColorProfile(ColorProfile $iccProfile) |
|
| 49 | { |
|
| 50 | $this->colorProfile = $iccProfile; |
|
| 51 | return $this; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||