Spot color conversion

This commit is contained in:
Jakub Melka
2021-02-15 20:04:06 +01:00
parent e63d5aa242
commit 6844114397
3 changed files with 138 additions and 3 deletions

View File

@ -177,7 +177,11 @@ public:
size_t getPixelIndex(size_t x, size_t y) const;
/// Extract process colors into another bitmap
PDFFloatBitmap extractProcessColors();
PDFFloatBitmap extractProcessColors() const;
/// Extract spot channel
/// \param channel Channel
PDFFloatBitmap extractSpotChannel(uint8_t channel) const;
enum class OverprintMode
{
@ -216,6 +220,11 @@ public:
OverprintMode overprintMode,
QRect blendRegion);
/// Blends converted spot colors, which are in \p convertedSpotColors bitmap.
/// Process colors must match.
/// \param convertedSpotColors Bitmap with converted spot colors
void blendConvertedSpots(const PDFFloatBitmap& convertedSpotColors);
void fillProcessColorChannels(PDFColorComponent value);
void fillChannel(size_t channel, PDFColorComponent value);
@ -316,6 +325,12 @@ public:
/// \param colorName Color name
const ColorInfo* getSpotColor(const QByteArray& colorName) const;
/// Returns active spot color with given index. If index
/// of the spot color is invalid, or no active spot color
/// is found, then nullptr is returned.
/// \param index Active color index
const ColorInfo* getActiveSpotColor(size_t index) const;
/// Activates / deactivates spot colors
/// \param active Make spot colors active?
void setSpotColorsActive(bool active);
@ -577,6 +592,7 @@ private:
PDFColorSpacePointer blendColorSpace;
bool filterColorsUsingMask = false;
uint32_t activeColorMask = PDFPixelFormat::getAllColorsMask();
bool transformSpotsToDevice = false;
};
struct PDFTransparencyPainterState
@ -666,6 +682,10 @@ private:
const PDFPainterPathSampler& clipSampler,
const PDFPainterPathSampler& pathSampler);
/// Collapses spot colors to device colors
/// \param data Bitmap with data
void collapseSpotColorsToDeviceColors(PDFFloatBitmapWithColorSpace& bitmap);
PDFColorSpacePointer m_deviceColorSpace; ///< Device color space (color space for final result)
PDFColorSpacePointer m_processColorSpace; ///< Process color space (color space, in which is page graphic's blended)
std::unique_ptr<PDFTransparencyGroupGuard> m_pageTransparencyGroupGuard;