mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
LibPDF: Add ColorSpaceFamily::operator==
No behavior change.
This commit is contained in:
parent
4f8e915ef8
commit
0f07049935
2 changed files with 7 additions and 2 deletions
|
@ -621,7 +621,7 @@ PDFErrorOr<NonnullRefPtr<ColorSpace>> IndexedColorSpace::create(Document* docume
|
|||
auto base_object = param0.get<NonnullRefPtr<Object>>();
|
||||
auto base = TRY(ColorSpace::create(document, base_object));
|
||||
|
||||
if (base->family().name() == ColorSpaceFamily::Pattern.name() || base->family().name() == ColorSpaceFamily::Indexed.name())
|
||||
if (base->family() == ColorSpaceFamily::Pattern || base->family() == ColorSpaceFamily::Indexed)
|
||||
return Error { Error::Type::MalformedPDF, "Indexed color space has invalid base color space" };
|
||||
|
||||
// "The hival parameter is an integer that specifies the maximum valid index value. In other words,
|
||||
|
@ -713,7 +713,7 @@ PDFErrorOr<NonnullRefPtr<SeparationColorSpace>> SeparationColorSpace::create(Doc
|
|||
auto alternate_space = TRY(ColorSpace::create(document, alternate_space_object));
|
||||
|
||||
auto family = alternate_space->family();
|
||||
if (family.name() == ColorSpaceFamily::Pattern.name() || family.name() == ColorSpaceFamily::Indexed.name() || family.name() == ColorSpaceFamily::Separation.name() || family.name() == ColorSpaceFamily::DeviceN.name())
|
||||
if (family == ColorSpaceFamily::Pattern || family == ColorSpaceFamily::Indexed || family == ColorSpaceFamily::Separation || family == ColorSpaceFamily::DeviceN)
|
||||
return Error { Error::Type::MalformedPDF, "Separation color space has invalid alternate color space" };
|
||||
|
||||
// "The tintTransform parameter must be a function"
|
||||
|
|
|
@ -44,6 +44,11 @@ public:
|
|||
ENUMERATE_COLOR_SPACE_FAMILIES(ENUMERATE)
|
||||
#undef ENUMERATE
|
||||
|
||||
bool operator==(ColorSpaceFamily const& other) const
|
||||
{
|
||||
return m_name == other.m_name;
|
||||
}
|
||||
|
||||
private:
|
||||
DeprecatedFlyString m_name;
|
||||
bool m_may_be_specified_directly;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue