mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:57:46 +00:00
LibPDF: Sketch out DeviceN color spaces a bit
Documents using them now show render-time diagnostics instead of asserting that number of parameters passed to a color don't match whatever number of channels the previously-set color space had. Fixes two asserts on the `-n 500` 0000.zip test set.
This commit is contained in:
parent
f915aa70cd
commit
f8bf9c6506
3 changed files with 66 additions and 0 deletions
|
@ -106,6 +106,23 @@ private:
|
|||
DeviceCMYKColorSpace() = default;
|
||||
};
|
||||
|
||||
class DeviceNColorSpace final : public ColorSpace {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<DeviceNColorSpace>> create(Document*, Vector<Value>&& parameters);
|
||||
|
||||
~DeviceNColorSpace() override = default;
|
||||
|
||||
PDFErrorOr<Color> color(ReadonlySpan<Value> arguments) const override;
|
||||
int number_of_components() const override;
|
||||
Vector<float> default_decode() const override;
|
||||
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::DeviceN; }
|
||||
|
||||
private:
|
||||
DeviceNColorSpace(size_t number_of_components);
|
||||
|
||||
size_t m_number_of_components { 0 };
|
||||
};
|
||||
|
||||
class CalRGBColorSpace final : public ColorSpace {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<CalRGBColorSpace>> create(Document*, Vector<Value>&& parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue