LibPDF: Implement two SeparationColorSpace methods

Actually using separation color spaces still doesn't work, but we
now no longer assert on them when they're used.

Fixes 2 crashes on the `-n 500` 0000.zip pdfa dataset.
This commit is contained in:
Nico Weber 2023-10-24 10:39:58 -07:00 committed by Andreas Kling
parent 2311e28d63
commit 311cc7d9b9
Notes: sideshowbarker 2024-07-17 21:16:31 +09:00
2 changed files with 2 additions and 3 deletions

View File

@ -396,8 +396,7 @@ PDFErrorOr<Color> SeparationColorSpace::color(ReadonlySpan<Value>) const
Vector<float> SeparationColorSpace::default_decode() const
{
warnln("PDF: TODO implement SeparationColorSpace::default_decode()");
return {};
return { 0.0f, 1.0f };
}
}

View File

@ -151,7 +151,7 @@ public:
~SeparationColorSpace() override = default;
PDFErrorOr<Color> color(ReadonlySpan<Value> arguments) const override;
int number_of_components() const override { TODO(); }
int number_of_components() const override { return 1; }
Vector<float> default_decode() const override;
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::Separation; }