mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibPDF: Implement CalGrayColorSpace
I haven't seen this being used in the wild, but it's used in Tests/LibPDF/colorspaces.pdf.
This commit is contained in:
parent
a207ab709a
commit
4a5136fc8c
3 changed files with 93 additions and 0 deletions
|
@ -123,6 +123,25 @@ private:
|
|||
size_t m_number_of_components { 0 };
|
||||
};
|
||||
|
||||
class CalGrayColorSpace final : public ColorSpace {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<CalGrayColorSpace>> create(Document*, Vector<Value>&& parameters);
|
||||
|
||||
~CalGrayColorSpace() override = default;
|
||||
|
||||
PDFErrorOr<Color> color(ReadonlySpan<Value> arguments) const override;
|
||||
int number_of_components() const override { return 1; }
|
||||
Vector<float> default_decode() const override;
|
||||
ColorSpaceFamily const& family() const override { return ColorSpaceFamily::CalGray; }
|
||||
|
||||
private:
|
||||
CalGrayColorSpace() = default;
|
||||
|
||||
Array<float, 3> m_whitepoint { 0, 0, 0 };
|
||||
Array<float, 3> m_blackpoint { 0, 0, 0 };
|
||||
float m_gamma { 1 };
|
||||
};
|
||||
|
||||
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