Fix of images, which have Lab as alternate color space; NOTES text file

This commit is contained in:
Jakub Melka 2020-09-19 17:07:40 +02:00
parent e417e06c6f
commit 5e603b7781
6 changed files with 181 additions and 51 deletions

105
NOTES.txt Normal file
View File

@ -0,0 +1,105 @@
Conformance to PDF 2.0 specification notes and tasks:
Section 1: OK
Section 2: OK
Section 3: OK
Section 4: OK
Section 5: OK
Section 6: OK
Section 7: Issues
- 7.4.7 JBIG2 decoder ammendments 1 and 2 not implemented
- 7.6.4 saving document with password not implemented
- 7.6.5 Public-key security handlers not implemented
- 7.6.7 Unencrypted wrapper document not implemented
- 7.10.2 Only linear interpolation for sampled function is performed
Section 8: Issues
- 8.3.2.3 In user space, 1 / 72 inch is used, no UserUnit entry is used
- 8.6.3 transfer functions and halftones are not used at all, color
management system is used to convert colors
- 8.6.5.6 No device to default color space is performed. Device color
spaces can be set in color management system.
- 8.6.5.8 default rendering intent is perceptual instead of relative colorimetric
- 8.6.5.9 Black point compensation is user setting, graphic state setting
is not respected (it is ignored)
- 8.6.7 Overprint not implemented
- 8.10.2 Some form dictionary entries, in table 93, are not all being processed
- 8.10.4 Reference XObject is not supported. Instead, proxy is displayed.
Section 9: Issues
- 9.3.2 Negative font size is not supported
- 9.3.8 Text knockout not implemented
- 9.5 Some type of fonts not supported yet (CIDFont, some others)
- 9.6.2.1 Missing width is not used for missing characters
- 9.6.4 d1 operator incorrectly doesn't ignore color/alpha operators
- 9.7.4 CIDSystemInfo ignored in Table 115
Section 10: Issues
- Color management system is used for color conversions. This can
be turned of, and in that case, methods from 10.4.2 are used.
Undercolor removal and black generation are not used.
- 10.6 Halftoning is not implemented
- 10.7.2 Flatness is ignored
- 10.7.3 Smoothness is ignored
- 10.7.5 Automatic stroke adjustment is ignored
- 10.8 Separations are not produced
- 10.8.3 Separation simulation is not performed
Section 11: Not implemented
- Transparency is not implemented, only a small fraction of pdf's
transparency works
Section 12: Issues
- 12.3.2.2 Destinations are used only to leap on specified page,
position on page or fit hints are ignored
- 12.3.5.2 File collection folders are ignored, files are
displayed in a single list
- 12.3.6 Navigator for file collections is ignored
- 12.4.2 Page indices are used instead of labels
- 12.4.4 Presentations are not implemented
- 12.5.5 Annotation's transparency group is ignored
- 12.5.6.3 Annotation's states are not implemented in viewer
- 12.5.6.22 Watermark annotation - matrix and fixed print entry is not used
- 12.6.3 Some trigger events are not executed or not implemented
- 12.6.4 Some action are not executed in viewer
- 12.6.4.8 URI actions doesn't use IsMap
- 12.7.4.3 Variable text is implemented by Qt's QTextLayout
and drawing, pdf's specific default appearance strings,
and rich text is not implemented. This doesn't conform
to PDF specification, but all unicode characters can be used.
- 12.7.5.5 Signature field locking not implemented and signature
seed dictionary is ignored
- 12.7.6.2 Sumbit form action not implemented in viewer
- 12.7.6.4 Import data action not implemented in viewer
- 12.7.8 Form data format not implemented
- 12.8 Modification detection using UR3/DocMDP method is not
used, if signature is not valid, then it is not checked for
modifications
- 12.8 OCSP (Online Certificate Status Protocol) is not performed
- 12.8.4 Long term validation of signatures not performed
- 12.8.4.5 Validation data in custom VRI are not used, instead of them,
validation data in DSS or embedded in the signature are used
- 12.8.5 Document timestamp dictionary not implemented
- 12.8.6 Permissions not implemented
- 12.9 Measure feature not implemented
- 12.10 Geospatial features not implemented
Section 13: Not implemented
- Multimedia features not implemented (except some classes, which
can read the data for multimedia - movies, sounds...)
Section 14: Issues
- 14.3 Document metadata stream is not processed
- 14.4 Modifiable file identifier is not updated
- 14.5 Page-piece dictionaries not implemented
- 14.9 Accessibility support not implemented
- 14.10 Web capture not implemented
- 14.11 Prepress support not implemented at all, only
basic functionality works (media box, crop box, or,
for example, reading output intents)
- 14.12 Document parts not implemented
Annex F: Not implemented
- Linearized PDF not implemented

View File

@ -33,13 +33,14 @@ namespace pdf
QColor PDFDeviceGrayColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
{
return getColor(PDFColor(0.0f), cms, intent, reporter);
return getColor(PDFColor(0.0f), cms, intent, reporter, true);
}
QColor PDFDeviceGrayColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFDeviceGrayColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(cms);
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
PDFColorComponent component = clip01(color[0]);
@ -71,12 +72,13 @@ void PDFDeviceGrayColorSpace::fillRGBBuffer(const std::vector<float>& colors, un
QColor PDFDeviceRGBColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
{
return getColor(PDFColor(0.0f, 0.0f, 0.0f), cms, intent, reporter);
return getColor(PDFColor(0.0f, 0.0f, 0.0f), cms, intent, reporter, true);
}
QColor PDFDeviceRGBColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFDeviceRGBColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
PDFColorComponent r = clip01(color[0]);
PDFColorComponent g = clip01(color[1]);
@ -109,12 +111,13 @@ void PDFDeviceRGBColorSpace::fillRGBBuffer(const std::vector<float>& colors, uns
QColor PDFDeviceCMYKColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
{
return getColor(PDFColor(0.0f, 0.0f, 0.0f, 1.0f), cms, intent, reporter);
return getColor(PDFColor(0.0f, 0.0f, 0.0f, 1.0f), cms, intent, reporter, true);
}
QColor PDFDeviceCMYKColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFDeviceCMYKColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
PDFColorComponent c = clip01(color[0]);
PDFColorComponent m = clip01(color[1]);
@ -393,7 +396,7 @@ QImage PDFAbstractColorSpace::getImage(const PDFImageData& imageData,
}
}
QColor transformedColor = getColor(color, cms, intent, reporter);
QColor transformedColor = getColor(color, cms, intent, reporter, true);
QRgb rgb = transformedColor.rgb();
*outputLine++ = qRed(rgb);
@ -435,7 +438,7 @@ void PDFAbstractColorSpace::fillRGBBuffer(const std::vector<float>& colors,
{
color[j] = *it++;
}
QColor transformedColor = getColor(color, cms, intent, reporter);
QColor transformedColor = getColor(color, cms, intent, reporter, true);
QRgb rgb = transformedColor.rgb();
*outputBuffer++ = qRed(rgb);
@ -451,7 +454,7 @@ QColor PDFAbstractColorSpace::getCheckedColor(const PDFColor& color, const PDFCM
throw PDFException(PDFTranslationContext::tr("Invalid number of color components. Expected number is %1, actual number is %2.").arg(static_cast<int>(getColorComponentCount())).arg(static_cast<int>(color.size())));
}
return getColor(color, cms, intent, reporter);
return getColor(color, cms, intent, reporter, true);
}
QImage PDFAbstractColorSpace::createAlphaMask(const PDFImageData& softMask)
@ -768,7 +771,7 @@ QColor PDFXYZColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent inte
{
color.push_back(0.0f);
}
return getColor(color, cms, intent, reporter);
return getColor(color, cms, intent, reporter, true);
}
PDFXYZColorSpace::PDFXYZColorSpace(PDFColor3 whitePoint) :
@ -790,9 +793,10 @@ PDFCalGrayColorSpace::PDFCalGrayColorSpace(PDFColor3 whitePoint, PDFColor3 black
}
QColor PDFCalGrayColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFCalGrayColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
const PDFColorComponent A = clip01(color[0]);
const PDFColorComponent xyzColor = std::powf(A, m_gamma);
@ -858,9 +862,10 @@ PDFCalRGBColorSpace::PDFCalRGBColorSpace(PDFColor3 whitePoint, PDFColor3 blackPo
}
QColor PDFCalRGBColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFCalRGBColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
const PDFColor3 ABC = clip01(PDFColor3{ color[0], color[1], color[2] });
const PDFColor3 ABCwithGamma = colorPowerByFactors(ABC, m_gamma);
@ -940,13 +945,26 @@ PDFLabColorSpace::PDFLabColorSpace(PDFColor3 whitePoint,
}
QColor PDFLabColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFLabColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
const PDFColorComponent LStar = qBound(0.0, interpolate(color[0], 0.0, 1.0, 0.0, 100.0), 100.0);
const PDFColorComponent aStar = qBound<PDFColorComponent>(m_aMin, interpolate(color[1], 0.0, 1.0, m_aMin, m_aMax), m_aMax);
const PDFColorComponent bStar = qBound<PDFColorComponent>(m_bMin, interpolate(color[2], 0.0, 1.0, m_bMin, m_bMax), m_bMax);
PDFColorComponent LStar = 0;
PDFColorComponent aStar = 0;
PDFColorComponent bStar = 0;
if (isRange01)
{
LStar = qBound(0.0, interpolate(color[0], 0.0, 1.0, 0.0, 100.0), 100.0);
aStar = qBound<PDFColorComponent>(m_aMin, interpolate(color[1], 0.0, 1.0, m_aMin, m_aMax), m_aMax);
bStar = qBound<PDFColorComponent>(m_bMin, interpolate(color[2], 0.0, 1.0, m_bMin, m_bMax), m_bMax);
}
else
{
LStar = qBound<PDFColorComponent>(0.0, color[0], 100.0);
aStar = qBound<PDFColorComponent>(m_aMin, color[1], m_aMax);
bStar = qBound<PDFColorComponent>(m_bMin, color[2], m_bMax);
}
const PDFColorComponent param1 = (LStar + 16.0f) / 116.0f;
const PDFColorComponent param2 = aStar / 500.0f;
@ -1071,12 +1089,13 @@ QColor PDFICCBasedColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent
{
color.push_back(0.0f);
}
return getColor(color, cms, intent, reporter);
return getColor(color, cms, intent, reporter, true);
}
QColor PDFICCBasedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFICCBasedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_ASSERT(color.size() == getColorComponentCount());
Q_UNUSED(isRange01);
size_t colorComponentCount = getColorComponentCount();
@ -1095,7 +1114,7 @@ QColor PDFICCBasedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms,
return cmsColor;
}
return m_alternateColorSpace->getColor(clippedColor, cms, intent, reporter);
return m_alternateColorSpace->getColor(clippedColor, cms, intent, reporter, true);
}
size_t PDFICCBasedColorSpace::getColorComponentCount() const
@ -1204,13 +1223,14 @@ PDFIndexedColorSpace::PDFIndexedColorSpace(PDFColorSpacePointer baseColorSpace,
QColor PDFIndexedColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
{
return getColor(PDFColor(0.0f), cms, intent, reporter);
return getColor(PDFColor(0.0f), cms, intent, reporter, true);
}
QColor PDFIndexedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFIndexedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
// Indexed color space value must have exactly one component!
Q_ASSERT(color.size() == 1);
Q_UNUSED(isRange01);
const int colorIndex = qBound(MIN_VALUE, static_cast<int>(color[0]), m_maxValue);
const int componentCount = static_cast<int>(m_baseColorSpace->getColorComponentCount());
@ -1229,7 +1249,7 @@ QColor PDFIndexedColorSpace::getColor(const PDFColor& color, const PDFCMS* cms,
decodedColor.push_back(component);
}
return m_baseColorSpace->getColor(decodedColor, cms, intent, reporter);
return m_baseColorSpace->getColor(decodedColor, cms, intent, reporter, true);
}
size_t PDFIndexedColorSpace::getColorComponentCount() const
@ -1275,7 +1295,7 @@ QImage PDFIndexedColorSpace::getImage(const PDFImageData& imageData,
PDFBitReader::Value index = reader.read();
color[0] = index;
QColor transformedColor = getColor(color, cms, intent, reporter);
QColor transformedColor = getColor(color, cms, intent, reporter, false);
QRgb rgb = transformedColor.rgb();
*outputLine++ = qRed(rgb);
@ -1323,7 +1343,7 @@ QImage PDFIndexedColorSpace::getImage(const PDFImageData& imageData,
PDFBitReader::Value index = reader.read();
color[0] = index;
QColor transformedColor = getColor(color, cms, intent, reporter);
QColor transformedColor = getColor(color, cms, intent, reporter, false);
QRgb rgb = transformedColor.rgb();
*outputLine++ = qRed(rgb);
@ -1401,13 +1421,14 @@ PDFSeparationColorSpace::PDFSeparationColorSpace(QByteArray&& colorName, PDFColo
QColor PDFSeparationColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
{
return getColor(PDFColor(1.0f), cms, intent, reporter);
return getColor(PDFColor(1.0f), cms, intent, reporter, true);
}
QColor PDFSeparationColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFSeparationColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
// Separation color space value must have exactly one component!
Q_ASSERT(color.size() == 1);
Q_UNUSED(isRange01);
// According to the PDF 2.0 specification, separation color space, with colorant name "None"
// should not produce any visible output.
@ -1437,7 +1458,7 @@ QColor PDFSeparationColorSpace::getColor(const PDFColor& color, const PDFCMS* cm
{
PDFColor color;
std::for_each(outputColor.cbegin(), outputColor.cend(), [&color](double value) { color.push_back(static_cast<float>(value)); });
return m_alternateColorSpace->getColor(color, cms, intent, reporter);
return m_alternateColorSpace->getColor(color, cms, intent, reporter, false);
}
else
{
@ -1500,12 +1521,13 @@ QColor PDFPatternColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent
return QColor(Qt::transparent);
}
QColor PDFPatternColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFPatternColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_UNUSED(color);
Q_UNUSED(cms);
Q_UNUSED(intent);
Q_UNUSED(reporter);
Q_UNUSED(isRange01);
throw PDFException(PDFTranslationContext::tr("Pattern doesn't have defined uniform color."));
}
@ -1546,11 +1568,13 @@ QColor PDFDeviceNColorSpace::getDefaultColor(const PDFCMS* cms, RenderingIntent
color[i] = 1.0;
}
return getColor(color, cms, intent, reporter);
return getColor(color, cms, intent, reporter, true);
}
QColor PDFDeviceNColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const
QColor PDFDeviceNColorSpace::getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const
{
Q_UNUSED(isRange01);
// According to the PDF 2.0 specification, DeviceN color space, with all colorant name "None"
// should not produce any visible output.
if (m_isNone)
@ -1574,7 +1598,7 @@ QColor PDFDeviceNColorSpace::getColor(const PDFColor& color, const PDFCMS* cms,
{
PDFColor color;
std::for_each(outputColor.cbegin(), outputColor.cend(), [&color](double value) { color.push_back(static_cast<float>(value)); });
return m_alternateColorSpace->getColor(color, cms, intent, reporter);
return m_alternateColorSpace->getColor(color, cms, intent, reporter, false);
}
else
{

View File

@ -238,7 +238,8 @@ public:
/// \param cms Color management system
/// \param intent Rendering intent
/// \param reporter Error reporter
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const = 0;
/// \param isRange01 Is range [0, 1], or native color component range (for Lab spaces)?
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const = 0;
/// Returns color component count
virtual size_t getColorComponentCount() const = 0;
@ -426,7 +427,7 @@ public:
virtual ~PDFDeviceGrayColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
};
@ -438,7 +439,7 @@ public:
virtual ~PDFDeviceRGBColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
};
@ -450,7 +451,7 @@ public:
virtual ~PDFDeviceCMYKColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
};
@ -479,7 +480,7 @@ public:
explicit PDFCalGrayColorSpace(PDFColor3 whitePoint, PDFColor3 blackPoint, PDFColorComponent gamma);
virtual ~PDFCalGrayColorSpace() = default;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
@ -499,7 +500,7 @@ public:
explicit PDFCalRGBColorSpace(PDFColor3 whitePoint, PDFColor3 blackPoint, PDFColor3 gamma, PDFColorComponentMatrix_3x3 matrix);
virtual ~PDFCalRGBColorSpace() = default;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
@ -520,7 +521,7 @@ public:
explicit PDFLabColorSpace(PDFColor3 whitePoint, PDFColor3 blackPoint, PDFColorComponent aMin, PDFColorComponent aMax, PDFColorComponent bMin, PDFColorComponent bMax);
virtual ~PDFLabColorSpace() = default;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors,unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
@ -547,7 +548,7 @@ public:
virtual ~PDFICCBasedColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual void fillRGBBuffer(const std::vector<float>& colors, unsigned char* outputBuffer, RenderingIntent intent, const PDFCMS* cms, PDFRenderErrorReporter* reporter) const override;
@ -580,7 +581,7 @@ public:
virtual ~PDFIndexedColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual QImage getImage(const PDFImageData& imageData,
const PDFImageData& softMask,
@ -616,7 +617,7 @@ public:
virtual ~PDFSeparationColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
bool isNone() const { return m_isNone; }
@ -672,7 +673,7 @@ public:
virtual ~PDFDeviceNColorSpace() = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
/// Returns type of DeviceN color space
@ -723,7 +724,7 @@ public:
virtual ~PDFPatternColorSpace() override = default;
virtual QColor getDefaultColor(const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter) const override;
virtual QColor getColor(const PDFColor& color, const PDFCMS* cms, RenderingIntent intent, PDFRenderErrorReporter* reporter, bool isRange01) const override;
virtual size_t getColorComponentCount() const override;
virtual const PDFPatternColorSpace* asPatternColorSpace() const override { return this; }

View File

@ -2298,7 +2298,7 @@ void PDFPageContentProcessor::operatorColorSetStrokingColor()
{
color.push_back(readOperand<PDFReal>(i));
}
m_graphicState.setStrokeColor(colorSpace->getColor(color, m_CMS, m_graphicState.getRenderingIntent(), this));
m_graphicState.setStrokeColor(colorSpace->getColor(color, m_CMS, m_graphicState.getRenderingIntent(), this, true));
updateGraphicState();
checkStrokingColor();
}
@ -2376,7 +2376,7 @@ void PDFPageContentProcessor::operatorColorSetFillingColor()
{
color.push_back(readOperand<PDFReal>(i));
}
m_graphicState.setFillColor(colorSpace->getColor(color, m_CMS, m_graphicState.getRenderingIntent(), this));
m_graphicState.setFillColor(colorSpace->getColor(color, m_CMS, m_graphicState.getRenderingIntent(), this, true));
updateGraphicState();
checkFillingColor();
}

View File

@ -764,7 +764,7 @@ private:
const size_t colorSpaceComponentCount = colorSpace->getColorComponentCount();
if (operandCount == colorSpaceComponentCount)
{
return colorSpace->getColor(PDFColor(static_cast<PDFColorComponent>(operands)...), m_CMS, m_graphicState.getRenderingIntent(), this);
return colorSpace->getColor(PDFColor(static_cast<PDFColorComponent>(operands)...), m_CMS, m_graphicState.getRenderingIntent(), this, true);
}
else
{

View File

@ -733,7 +733,7 @@ PDFMesh PDFFunctionShading::createMesh(const PDFMeshQualitySettings& settings, c
}
}
return m_colorSpace->getColor(PDFAbstractColorSpace::convertToColor(colorBuffer), cms, intent, reporter);
return m_colorSpace->getColor(PDFAbstractColorSpace::convertToColor(colorBuffer), cms, intent, reporter, true);
};
PDFMesh::Triangle triangle1;
@ -966,7 +966,7 @@ PDFMesh PDFAxialShading::createMesh(const PDFMeshQualitySettings& settings, cons
uint32_t bottomRight = mesh.addVertex(QPointF(item.first, yb));
PDFColor mixedColor = PDFAbstractColorSpace::mixColors(previousColor, item.second, 0.5);
QColor color = m_colorSpace->getColor(mixedColor, cms, intent, reporter);
QColor color = m_colorSpace->getColor(mixedColor, cms, intent, reporter, true);
mesh.addQuad(topLeft, topRight, bottomRight, bottomLeft, color.rgb());
topLeft = topRight;
@ -1392,7 +1392,7 @@ PDFMesh PDFRadialShading::createMesh(const PDFMeshQualitySettings& settings, con
uint32_t v3 = mesh.addVertex(p3);
uint32_t v4 = mesh.addVertex(p4);
QColor color = m_colorSpace->getColor(mixedColor, cms, intent, reporter);
QColor color = m_colorSpace->getColor(mixedColor, cms, intent, reporter, true);
mesh.addQuad(v1, v2, v3, v4, color.rgb());
angle0 = angle1;
@ -1780,7 +1780,7 @@ void PDFType4567Shading::addSubdividedTriangles(const PDFMeshQualitySettings& se
color[i] = (c1[i] + c2[i] + c3[i]) * coefficient;
}
Q_ASSERT(colorComponents == m_colorSpace->getColorComponentCount());
QColor transformedColor = m_colorSpace->getColor(color, cms, intent, reporter);
QColor transformedColor = m_colorSpace->getColor(color, cms, intent, reporter, true);
PDFMesh::Triangle triangle;
triangle.v1 = v1;
@ -2392,7 +2392,7 @@ void PDFTensorProductPatchShadingBase::fillMesh(PDFMesh& mesh,
QPointF center = triangle.getCenter();
PDFColor color = getColorForUV(center.x(), center.y());
QRgb rgbColor = m_colorSpace->getColor(color, cms, intent, reporter).rgb();
QRgb rgbColor = m_colorSpace->getColor(color, cms, intent, reporter, true).rgb();
PDFMesh::Triangle meshTriangle;
meshTriangle.v1 = static_cast<uint32_t>(vertexIndex++);