|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
+#include "AK/Forward.h"
|
|
|
#include <AK/FlyString.h>
|
|
|
#include <LibGfx/Color.h>
|
|
|
#include <LibPDF/Value.h>
|
|
@@ -54,6 +55,8 @@ public:
|
|
|
virtual ~ColorSpace() = default;
|
|
|
|
|
|
virtual Color color(Vector<Value> const& arguments) const = 0;
|
|
|
+ virtual int number_of_components() const = 0;
|
|
|
+ virtual Vector<float> default_decode() const = 0;
|
|
|
virtual ColorSpaceFamily const& family() const = 0;
|
|
|
};
|
|
|
|
|
@@ -64,6 +67,8 @@ public:
|
|
|
~DeviceGrayColorSpace() override = default;
|
|
|
|
|
|
Color color(Vector<Value> const& arguments) const override;
|
|
|
+ int number_of_components() const override { return 1; }
|
|
|
+ Vector<float> default_decode() const override;
|
|
|
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::DeviceGray; }
|
|
|
|
|
|
private:
|
|
@@ -77,6 +82,8 @@ public:
|
|
|
~DeviceRGBColorSpace() override = default;
|
|
|
|
|
|
Color color(Vector<Value> const& arguments) const override;
|
|
|
+ int number_of_components() const override { return 3; }
|
|
|
+ Vector<float> default_decode() const override;
|
|
|
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::DeviceRGB; }
|
|
|
|
|
|
private:
|
|
@@ -90,6 +97,8 @@ public:
|
|
|
~DeviceCMYKColorSpace() override = default;
|
|
|
|
|
|
Color color(Vector<Value> const& arguments) const override;
|
|
|
+ int number_of_components() const override { return 4; }
|
|
|
+ Vector<float> default_decode() const override;
|
|
|
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::DeviceCMYK; }
|
|
|
|
|
|
private:
|
|
@@ -103,6 +112,8 @@ public:
|
|
|
~CalRGBColorSpace() override = default;
|
|
|
|
|
|
Color color(Vector<Value> const& arguments) const override;
|
|
|
+ int number_of_components() const override { return 3; }
|
|
|
+ Vector<float> default_decode() const override;
|
|
|
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::CalRGB; }
|
|
|
|
|
|
private:
|
|
@@ -121,6 +132,8 @@ public:
|
|
|
~ICCBasedColorSpace() override = default;
|
|
|
|
|
|
Color color(Vector<Value> const& arguments) const override;
|
|
|
+ int number_of_components() const override { VERIFY_NOT_REACHED(); }
|
|
|
+ Vector<float> default_decode() const override;
|
|
|
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::ICCBased; }
|
|
|
|
|
|
private:
|