mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
LibPDF: Add ColorSpaceFamily::operator==
No behavior change.
This commit is contained in:
parent
4f8e915ef8
commit
0f07049935
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/0f07049935 Pull-request: https://github.com/SerenityOS/serenity/pull/21819 Reviewed-by: https://github.com/AtkinsSJ
@ -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…
Reference in New Issue
Block a user