mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:37:36 +00:00
LibPDF: Move color space creation from Renderer to ColorSpace
This commit is contained in:
parent
8e175b4959
commit
1238e65d30
3 changed files with 52 additions and 41 deletions
|
@ -25,8 +25,12 @@
|
|||
|
||||
namespace PDF {
|
||||
|
||||
class Page;
|
||||
|
||||
class ColorSpace : public RefCounted<ColorSpace> {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<ColorSpace>> create(Document*, FlyString const& name, Page const& page);
|
||||
|
||||
virtual ~ColorSpace() = default;
|
||||
|
||||
virtual Color color(Vector<Value> const& arguments) const = 0;
|
||||
|
@ -36,9 +40,9 @@ class DeviceGrayColorSpace final : public ColorSpace {
|
|||
public:
|
||||
static NonnullRefPtr<DeviceGrayColorSpace> the();
|
||||
|
||||
virtual ~DeviceGrayColorSpace() override = default;
|
||||
~DeviceGrayColorSpace() override = default;
|
||||
|
||||
virtual Color color(Vector<Value> const& arguments) const override;
|
||||
Color color(Vector<Value> const& arguments) const override;
|
||||
|
||||
private:
|
||||
DeviceGrayColorSpace() = default;
|
||||
|
@ -48,9 +52,9 @@ class DeviceRGBColorSpace final : public ColorSpace {
|
|||
public:
|
||||
static NonnullRefPtr<DeviceRGBColorSpace> the();
|
||||
|
||||
virtual ~DeviceRGBColorSpace() override = default;
|
||||
~DeviceRGBColorSpace() override = default;
|
||||
|
||||
virtual Color color(Vector<Value> const& arguments) const override;
|
||||
Color color(Vector<Value> const& arguments) const override;
|
||||
|
||||
private:
|
||||
DeviceRGBColorSpace() = default;
|
||||
|
@ -60,9 +64,9 @@ class DeviceCMYKColorSpace final : public ColorSpace {
|
|||
public:
|
||||
static NonnullRefPtr<DeviceCMYKColorSpace> the();
|
||||
|
||||
virtual ~DeviceCMYKColorSpace() override = default;
|
||||
~DeviceCMYKColorSpace() override = default;
|
||||
|
||||
virtual Color color(Vector<Value> const& arguments) const override;
|
||||
Color color(Vector<Value> const& arguments) const override;
|
||||
|
||||
private:
|
||||
DeviceCMYKColorSpace() = default;
|
||||
|
@ -70,10 +74,11 @@ private:
|
|||
|
||||
class CalRGBColorSpace final : public ColorSpace {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<CalRGBColorSpace>> create(RefPtr<Document>, Vector<Value>&& parameters);
|
||||
virtual ~CalRGBColorSpace() override = default;
|
||||
static PDFErrorOr<NonnullRefPtr<CalRGBColorSpace>> create(Document*, Vector<Value>&& parameters);
|
||||
|
||||
virtual Color color(Vector<Value> const& arguments) const override;
|
||||
~CalRGBColorSpace() override = default;
|
||||
|
||||
Color color(Vector<Value> const& arguments) const override;
|
||||
|
||||
private:
|
||||
CalRGBColorSpace() = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue