mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Fix of images, which have Lab as alternate color space; NOTES text file
This commit is contained in:
@ -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
|
||||
{
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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++);
|
||||
|
Reference in New Issue
Block a user