Bugfix: cmyk over spot color

This commit is contained in:
Jakub Melka 2021-02-18 18:34:29 +01:00
parent 63218a40dd
commit 114dfcb895
2 changed files with 15 additions and 0 deletions

View File

@ -148,6 +148,11 @@ void PDFFloatBitmap::setAllColorActive()
std::fill(m_activeColorMask.begin(), m_activeColorMask.end(), PDFPixelFormat::getAllColorsMask());
}
void PDFFloatBitmap::setAllColorInactive()
{
std::fill(m_activeColorMask.begin(), m_activeColorMask.end(), 0);
}
PDFFloatBitmap PDFFloatBitmap::extractProcessColors() const
{
PDFPixelFormat format = PDFPixelFormat::createFormat(m_format.getProcessColorChannelCount(), 0, false, m_format.hasProcessColorsSubtractive(), false);
@ -363,6 +368,12 @@ void PDFFloatBitmap::blend(const PDFFloatBitmap& source,
continue;
}
if (target.hasActiveColorMask())
{
const uint32_t activeColorChannels = source.hasActiveColorMask() ? source.getPixelActiveColorMask(x, y) : PDFPixelFormat::getAllColorsMask();
target.markPixelActiveColorMask(x, y, activeColorChannels);
}
std::fill(B_i.begin(), B_i.end(), 0.0f);
// Calculate blended pixel
@ -2289,6 +2300,7 @@ void PDFTransparencyRenderer::PDFTransparencyGroupPainterData::makeInitialBackdr
void PDFTransparencyRenderer::PDFTransparencyGroupPainterData::makeImmediateBackdropTransparent()
{
immediateBackdrop.makeTransparent();
immediateBackdrop.setAllColorInactive();
}
void PDFTransparencyRenderer::PDFTransparencyGroupPainterData::makeSoftMaskOpaque()

View File

@ -205,6 +205,9 @@ public:
/// Sets all colors as active
void setAllColorActive();
/// Sets all colors as inactive
void setAllColorInactive();
/// Extract process colors into another bitmap
PDFFloatBitmap extractProcessColors() const;