Krita Source Code Documentation
Loading...
Searching...
No Matches
KisHalftoneFilter Class Reference

#include <KisHalftoneFilter.h>

+ Inheritance diagram for KisHalftoneFilter:

Public Member Functions

KisConfigWidgetcreateConfigurationWidget (QWidget *parent, const KisPaintDeviceSP dev, bool useForMasks) const override
 
KisFilterConfigurationSP defaultConfiguration (KisResourcesInterfaceSP resourcesInterface) const override
 
KisFilterConfigurationSP factoryConfiguration (KisResourcesInterfaceSP resourcesInterface) const override
 
 KisHalftoneFilter ()
 
void processImpl (KisPaintDeviceSP device, const QRect &applyRect, const KisFilterConfigurationSP config, KoUpdater *progressUpdater) const override
 
- Public Member Functions inherited from KisFilter
virtual QRect changedRect (const QRect &rect, const KisFilterConfigurationSP config, int lod) const
 
virtual bool configurationAllowedForMask (KisFilterConfigurationSP config) const
 
virtual void fixLoadedFilterConfigurationForMasks (KisFilterConfigurationSP config) const
 
 KisFilter (const KoID &id, const KoID &category, const QString &entry)
 
virtual QRect neededRect (const QRect &rect, const KisFilterConfigurationSP config, int lod) const
 
virtual bool needsTransparentPixels (const KisFilterConfigurationSP config, const KoColorSpace *cs) const
 
void process (const KisPaintDeviceSP src, KisPaintDeviceSP dst, KisSelectionSP selection, const QRect &applyRect, const KisFilterConfigurationSP config, KoUpdater *progressUpdater=0) const
 
void process (KisPaintDeviceSP device, const QRect &applyRect, const KisFilterConfigurationSP config, KoUpdater *progressUpdater=0) const
 
virtual bool supportsLevelOfDetail (const KisFilterConfigurationSP config, int lod) const
 
 ~KisFilter () override
 
- Public Member Functions inherited from KisBaseProcessor
KisBookmarkedConfigurationManagerbookmarkManager ()
 
const KisBookmarkedConfigurationManagerbookmarkManager () const
 
ColorSpaceIndependence colorSpaceIndependence () const
 
QString id () const
 
 KisBaseProcessor (const KoID &id, const KoID &category, const QString &entry)
 
KoID menuCategory () const
 
QString menuEntry () const
 
QString name () const
 
 Private ()
 
QKeySequence shortcut () const
 
bool showConfigurationWidget ()
 If true, the filter wants to show a configuration widget.
 
bool supportsAdjustmentLayers () const
 This filter can be used in adjustment layers.
 
bool supportsPainting () const
 
bool supportsThreading () const
 
virtual ~KisBaseProcessor ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisShared
bool deref ()
 
bool ref ()
 
int refCount ()
 
QAtomicInt * sharedWeakReference ()
 

Static Public Member Functions

static KoID id ()
 

Private Member Functions

bool checkUpdaterInterruptedAndSetPercent (KoUpdater *progressUpdater, int percent) const
 
KisPaintDeviceSP makeGeneratorPaintDevice (KisPaintDeviceSP prototype, const QString &prefix, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
 
void processAlpha (KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
 
template<typename ChannelType >
void processChannel (KisPaintDeviceSP device, KisPaintDeviceSP generatorDevice, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, const QString &prefix, KoChannelInfo *channelInfo) const
 
void processChannels (KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
 
void processIntensity (KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
 
void processMask (KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
 

Static Private Member Functions

static QVector< quint8 > makeHardnessLut (qreal hardness)
 
static QVector< quint8 > makeNoiseWeightLut (qreal hardness)
 
static quint8 mapU8ToRange (quint8 value, quint8 new_min, quint8 new_max)
 
template<typename T >
static T mapU8ToRange (quint8 value, T new_min, T new_max)
 

Private Attributes

KisCachedPaintDevice m_genericDevicesCache
 
KisCachedPaintDevice m_grayDevicesCache
 
KisCachedSelection m_selectionsCache
 

Additional Inherited Members

- Public Attributes inherited from KisBaseProcessor
KisBookmarkedConfigurationManagerbookmarkManager
 
KoID category
 
ColorSpaceIndependence colorSpaceIndependence
 
QString entry
 
KoID id
 
QKeySequence shortcut
 
bool showConfigurationWidget
 
bool supportsAdjustmentLayers
 
bool supportsPainting
 
bool supportsThreading
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Protected Member Functions inherited from KisFilter
QString configEntryGroup () const
 
void setSupportsLevelOfDetail (bool value)
 
- Protected Member Functions inherited from KisBaseProcessor
void init (const QString &configEntryGroup)
 
void setColorSpaceIndependence (ColorSpaceIndependence v)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShowConfigurationWidget (bool v)
 
void setSupportsAdjustmentLayers (bool v)
 
void setSupportsPainting (bool v)
 
void setSupportsThreading (bool v)
 
- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 

Detailed Description

Definition at line 31 of file KisHalftoneFilter.h.

Constructor & Destructor Documentation

◆ KisHalftoneFilter()

KisHalftoneFilter::KisHalftoneFilter ( )

Definition at line 42 of file KisHalftoneFilter.cpp.

43 : KisFilter(id(), FiltersCategoryArtisticId, i18n("&Halftone..."))
44{
46}
KisFilter(const KoID &id, const KoID &category, const QString &entry)
Definition kis_filter.cc:22
const KoID FiltersCategoryArtisticId("artistic_filters", ki18nc("The category of artistic filters, like raindrops. Adjective.", "Artistic"))
void setSupportsPainting(bool v)

References KisBaseProcessor::setSupportsPainting().

Member Function Documentation

◆ checkUpdaterInterruptedAndSetPercent()

bool KisHalftoneFilter::checkUpdaterInterruptedAndSetPercent ( KoUpdater * progressUpdater,
int percent ) const
private

Definition at line 173 of file KisHalftoneFilter.cpp.

174{
175 // The updater is null so return false to keep going
176 // with the computations
177 if (!progressUpdater) {
178 return false;
179 }
180
181 if (progressUpdater->interrupted()) {
182 return true;
183 }
184
185 progressUpdater->setProgress(percent);
186 return false;
187}
bool interrupted() const
Definition KoUpdater.cpp:54
void setProgress(int percent)
Definition KoUpdater.cpp:38

References KoUpdater::interrupted(), and KoUpdater::setProgress().

◆ createConfigurationWidget()

KisConfigWidget * KisHalftoneFilter::createConfigurationWidget ( QWidget * parent,
const KisPaintDeviceSP dev,
bool useForMasks ) const
overridevirtual

Create the configuration widget for this processor.

Parameters
parentthe Qt owner widget of this widget
devthe paintdevice this filter will act on
useForMasksshown if the filer is going to be used in a mask. Some filters may provide limited options when applied as a mask (e.g. Gaussian Blur)

Reimplemented from KisBaseProcessor.

Definition at line 706 of file KisHalftoneFilter.cpp.

707{
708 Q_UNUSED(useForMasks);
709 return new KisHalftoneConfigWidget(parent, dev);
710}

◆ defaultConfiguration()

KisFilterConfigurationSP KisHalftoneFilter::defaultConfiguration ( KisResourcesInterfaceSP resourcesInterface) const
overridevirtual

Return the configuration set as the default by the user or the default configuration from the filter writer as returned by factoryConfiguration.

This configuration is used by default for the configuration widget and given to the process function if there is no configuration widget.

Returns
the default configuration of this widget

Reimplemented from KisBaseProcessor.

Definition at line 628 of file KisHalftoneFilter.cpp.

629{
631 dynamic_cast<KisHalftoneFilterConfiguration*>(factoryConfiguration(resourcesInterface).data());
632
633 filterConfig->setMode(KisHalftoneFilterConfiguration::defaultMode());
634
635 QString defaultGeneratorId = KisHalftoneFilterConfiguration::defaultGeneratorId();
636 KisGeneratorSP defaultGenerator = KisGeneratorRegistry::instance()->get(defaultGeneratorId);
637
638 // intensity
639 filterConfig->setGeneratorId("intensity_", defaultGeneratorId);
640 if (defaultGenerator) {
641 KisFilterConfigurationSP defaultGeneratorConfiguration =
642 defaultGenerator->defaultConfiguration(resourcesInterface);
643 if (defaultGeneratorId == "screentone") {
644 defaultGeneratorConfiguration->setProperty("rotation", 45.0);
645 defaultGeneratorConfiguration->setProperty("contrast", 50.0);
646 }
647 filterConfig->setGeneratorConfiguration("intensity_", defaultGeneratorConfiguration);
648 }
649 filterConfig->setHardness("intensity_", KisHalftoneFilterConfiguration::defaultHardness());
650 filterConfig->setInvert("intensity_", KisHalftoneFilterConfiguration::defaultInvert());
651 filterConfig->setForegroundColor("intensity_", KisHalftoneFilterConfiguration::defaultForegroundColor());
652 filterConfig->setForegroundOpacity("intensity_", KisHalftoneFilterConfiguration::defaultForegroundOpacity());
653 filterConfig->setBackgroundColor("intensity_", KisHalftoneFilterConfiguration::defaultBackgroundColor());
654 filterConfig->setBackgroundOpacity("intensity_", KisHalftoneFilterConfiguration::defaultBackgroundOpacity());
655
656 // Alpha
657 filterConfig->setGeneratorId("alpha_", defaultGeneratorId);
658 if (defaultGenerator) {
659 KisFilterConfigurationSP defaultGeneratorConfiguration =
660 defaultGenerator->defaultConfiguration(resourcesInterface);
661 if (defaultGeneratorId == "screentone") {
662 defaultGeneratorConfiguration->setProperty("rotation", 45.0);
663 defaultGeneratorConfiguration->setProperty("contrast", 50.0);
664 }
665 filterConfig->setGeneratorConfiguration("alpha_", defaultGeneratorConfiguration);
666 }
667 filterConfig->setHardness("alpha_", KisHalftoneFilterConfiguration::defaultHardness());
668 filterConfig->setInvert("alpha_", KisHalftoneFilterConfiguration::defaultInvert());
669
670 // The channels only use default generator if it is screentone
671 // because there are predefined ways of presenting the patterns (screen angles)
672
673 // Map channel prefixes to rotation angle
674 QHash<QString, qreal> channelDict;
675 channelDict.insert("RGBA_channel0_", 15.0);
676 channelDict.insert("RGBA_channel1_", 45.0);
677 channelDict.insert("RGBA_channel2_", 75.0);
678 channelDict.insert("CMYKA_channel0_", 15.0);
679 channelDict.insert("CMYKA_channel1_", 75.0);
680 channelDict.insert("CMYKA_channel2_", 0.0);
681 channelDict.insert("CMYKA_channel3_", 45.0);
682
683 for (auto i = channelDict.constBegin(); i != channelDict.constEnd(); ++i) {
684 if (defaultGenerator && defaultGeneratorId == "screentone") {
685 filterConfig->setGeneratorId(i.key(), "screentone");
686 KisFilterConfigurationSP defaultGeneratorConfiguration =
687 defaultGenerator->defaultConfiguration(resourcesInterface);
688 defaultGeneratorConfiguration->setProperty("rotation", i.value());
689 defaultGeneratorConfiguration->setProperty("contrast", 50.0);
690 filterConfig->setGeneratorConfiguration(i.key(), defaultGeneratorConfiguration);
691 } else {
692 filterConfig->setGeneratorId(i.key(), "");
693 }
694 filterConfig->setHardness(i.key(), KisHalftoneFilterConfiguration::defaultHardness());
695 filterConfig->setInvert(i.key(), KisHalftoneFilterConfiguration::defaultInvert());
696 }
697
698 return filterConfig;
699}
static KisGeneratorRegistry * instance()
KisFilterConfigurationSP factoryConfiguration(KisResourcesInterfaceSP resourcesInterface) const override
T get(const QString &id) const
virtual KisFilterConfigurationSP defaultConfiguration(KisResourcesInterfaceSP resourcesInterface) const

References KisSharedPtr< T >::data(), KisHalftoneFilterConfiguration::defaultBackgroundColor(), KisHalftoneFilterConfiguration::defaultBackgroundOpacity(), KisBaseProcessor::defaultConfiguration(), KisHalftoneFilterConfiguration::defaultForegroundColor(), KisHalftoneFilterConfiguration::defaultForegroundOpacity(), KisHalftoneFilterConfiguration::defaultGeneratorId(), KisHalftoneFilterConfiguration::defaultHardness(), KisHalftoneFilterConfiguration::defaultInvert(), KisHalftoneFilterConfiguration::defaultMode(), factoryConfiguration(), KoGenericRegistry< T >::get(), and KisGeneratorRegistry::instance().

◆ factoryConfiguration()

KisFilterConfigurationSP KisHalftoneFilter::factoryConfiguration ( KisResourcesInterfaceSP resourcesInterface) const
overridevirtual
Returns
the default configuration object as defined by whoever wrote the plugin. This object must be filled in with fromXML after that.

Reimplemented from KisBaseProcessor.

Definition at line 701 of file KisHalftoneFilter.cpp.

702{
703 return new KisHalftoneFilterConfiguration("halftone", 1, resourcesInterface);
704}

◆ id()

static KoID KisHalftoneFilter::id ( )
inlinestatic

Definition at line 36 of file KisHalftoneFilter.h.

36 {
37 return KoID("halftone", i18n("Halftone"));
38 }
Definition KoID.h:30

◆ makeGeneratorPaintDevice()

KisPaintDeviceSP KisHalftoneFilter::makeGeneratorPaintDevice ( KisPaintDeviceSP prototype,
const QString & prefix,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
KoUpdater * progressUpdater ) const
private

Definition at line 142 of file KisHalftoneFilter.cpp.

147{
148 const QString generatorId = config->generatorId(prefix);
149 if (generatorId.isEmpty()) {
150 return nullptr;
151 }
152
153 KisGeneratorSP generator = KisGeneratorRegistry::instance()->get(generatorId);
154 KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(generator, nullptr);
155
156 KisFilterConfigurationSP generatorConfiguration = config->generatorConfiguration(prefix);
157 KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(generatorConfiguration, nullptr);
158
159 // Fill the generator device
160 KisPaintDeviceSP generatorDevice = m_grayDevicesCache.getDevice(prototype, KoColorSpaceRegistry::instance()->graya8());
161
162 KisProcessingInformation(generatorDevice, applyRect.topLeft(), KisSelectionSP());
163 generator->generate(
164 KisProcessingInformation(generatorDevice, applyRect.topLeft(),KisSelectionSP()),
165 applyRect.size(),
166 generatorConfiguration,
167 progressUpdater
168 );
169
170 return generatorDevice;
171}
KisPaintDeviceSP getDevice(KisPaintDeviceSP prototype)
virtual void generate(KisProcessingInformation dst, const QSize &size, const KisFilterConfigurationSP config, KoUpdater *progressUpdater) const =0
QString generatorId(const QString &prefix) const
KisFilterConfigurationSP generatorConfiguration(const QString &prefix) const
KisCachedPaintDevice m_grayDevicesCache
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129
static KoColorSpaceRegistry * instance()

References KisGenerator::generate(), KisHalftoneFilterConfiguration::generatorConfiguration(), KisHalftoneFilterConfiguration::generatorId(), KoGenericRegistry< T >::get(), KisCachedPaintDevice::getDevice(), KisGeneratorRegistry::instance(), KoColorSpaceRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and m_grayDevicesCache.

◆ makeHardnessLut()

QVector< quint8 > KisHalftoneFilter::makeHardnessLut ( qreal hardness)
staticprivate

Definition at line 113 of file KisHalftoneFilter.cpp.

114{
115 QVector<quint8> hardnessLut(256);
116 if (qFuzzyCompare(hardness, 1.0)) {
117 for (int i = 0; i < 256; ++i) {
118 hardnessLut[i] = i < 128 ? 0 : 255;
119 }
120 } else {
121 qreal m = 1.0 / (1.0 - hardness);
122 qreal b = -m * (hardness / 2.0);
123 for (int i = 0; i < 256; ++i) {
124 hardnessLut[i] = qBound(0, static_cast<int>(qRound((m * (i / 255.0) + b) * 255.0)), 255);
125 }
126 }
127 return hardnessLut;
128}
static bool qFuzzyCompare(half p1, half p2)

References qFuzzyCompare().

◆ makeNoiseWeightLut()

QVector< quint8 > KisHalftoneFilter::makeNoiseWeightLut ( qreal hardness)
staticprivate

Definition at line 130 of file KisHalftoneFilter.cpp.

131{
132 QVector<quint8> noiseWeightLut(256);
133 hardness *= 0.99;
134 for (int i = 0; i < 256; ++i) {
135 qreal iNorm = i / 255.0;
136 qreal weight = (2.0 - std::abs(4.0 * iNorm - 2.0)) + hardness;
137 noiseWeightLut[i] = qBound(0, static_cast<int>(qRound(weight * 255.0)), 255);
138 }
139 return noiseWeightLut;
140}

◆ mapU8ToRange() [1/2]

static quint8 KisHalftoneFilter::mapU8ToRange ( quint8 value,
quint8 new_min,
quint8 new_max )
inlinestaticprivate

Definition at line 57 of file KisHalftoneFilter.h.

57 {
58 Q_UNUSED(new_min);
59 Q_UNUSED(new_max);
60 return value;
61 }
float value(const T *src, size_t ch)

References value().

◆ mapU8ToRange() [2/2]

template<typename T >
static T KisHalftoneFilter::mapU8ToRange ( quint8 value,
T new_min,
T new_max )
inlinestaticprivate

Definition at line 63 of file KisHalftoneFilter.h.

63 {
64 return value * (new_max - new_min) / 255 + new_min;
65 }

References value().

◆ processAlpha()

void KisHalftoneFilter::processAlpha ( KisPaintDeviceSP device,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
KoUpdater * progressUpdater ) const
private

Definition at line 498 of file KisHalftoneFilter.cpp.

502{
503 const QString prefix = "alpha_";
504
505 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 0)) {
506 return;
507 }
508
509 // Make the generator device
510 KisPaintDeviceSP generatorDevice = makeGeneratorPaintDevice(device, prefix, applyRect, config, nullptr);
511 if (!generatorDevice) {
512 return;
513 }
514 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 50)) {
515 return;
516 }
517
518 // Make the hardness and the noise weight LUT
519 const qreal hardness = config->hardness(prefix) / 100.0;
520 const QVector<quint8> hardnessLut = makeHardnessLut(hardness);
521 const QVector<quint8> noiseWeightLut = makeNoiseWeightLut(hardness);
522
523 // Fill the device
524 const bool invert = config->invert(prefix);
525 KisSequentialIterator dstIterator(device, applyRect);
526 KisSequentialIterator srcIterator(generatorDevice, applyRect);
527
528 if (!invert) {
529 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
530 int dst = 255 - device->colorSpace()->opacityU8(dstIterator.rawData());
531 int src = srcIterator.rawData()[0];
532 int srcAlpha = srcIterator.rawData()[1];
533
534 // Combine pixels
535 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
536
537 // Apply hardness
538 result = hardnessLut[result];
539
540 device->colorSpace()->setOpacity(dstIterator.rawData(), static_cast<quint8>(255 - result), 1);
541 }
542 } else {
543 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
544 int dst = device->colorSpace()->opacityU8(dstIterator.rawData());
545 int src = srcIterator.rawData()[0];
546 int srcAlpha = srcIterator.rawData()[1];
547
548 // Combine pixels
549 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
550
551 // Apply hardness
552 result = hardnessLut[result];
553
554 device->colorSpace()->setOpacity(dstIterator.rawData(), static_cast<quint8>(result), 1);
555 }
556 }
557 m_grayDevicesCache.putDevice(generatorDevice);
558
559 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 100)) {
560 return;
561 }
562}
void putDevice(KisPaintDeviceSP device)
qreal hardness(const QString &prefix) const
bool invert(const QString &prefix) const
static QVector< quint8 > makeHardnessLut(qreal hardness)
KisPaintDeviceSP makeGeneratorPaintDevice(KisPaintDeviceSP prototype, const QString &prefix, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
bool checkUpdaterInterruptedAndSetPercent(KoUpdater *progressUpdater, int percent) const
static QVector< quint8 > makeNoiseWeightLut(qreal hardness)
const KoColorSpace * colorSpace() const
virtual void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
virtual quint8 opacityU8(const quint8 *pixel) const =0

References checkUpdaterInterruptedAndSetPercent(), KisPaintDevice::colorSpace(), KisHalftoneFilterConfiguration::hardness(), KisHalftoneFilterConfiguration::invert(), m_grayDevicesCache, makeGeneratorPaintDevice(), makeHardnessLut(), makeNoiseWeightLut(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KoColorSpace::opacityU8(), KisCachedPaintDevice::putDevice(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KoColorSpace::setOpacity().

◆ processChannel()

template<typename ChannelType >
void KisHalftoneFilter::processChannel ( KisPaintDeviceSP device,
KisPaintDeviceSP generatorDevice,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
const QString & prefix,
KoChannelInfo * channelInfo ) const
private

Definition at line 312 of file KisHalftoneFilter.cpp.

318{
319 const int channelPos = channelInfo->pos() / sizeof(ChannelType);
320 // Make the hardness and the noise weight LUT
321 const qreal hardness = config->hardness(prefix) / 100.0;
322 const QVector<quint8> hardnessLut = makeHardnessLut(hardness);
323 const QVector<quint8> noiseWeightLut = makeNoiseWeightLut(hardness);
324
325 // Fill the device
326 const bool invert = config->invert(prefix);
327 KisSequentialIterator dstIterator(device, applyRect);
328 KisSequentialIterator srcIterator(generatorDevice, applyRect);
329
330 const KoColorSpace *colorSpace = device->colorSpace();
331
332 if (colorSpace->profile()->isLinear()) {
333 if (!invert) {
334 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
335 int dst = 255 - device->colorSpace()->scaleToU8(dstIterator.rawData(), channelPos);
336 int src = srcIterator.rawData()[0];
337 int srcAlpha = srcIterator.rawData()[1];
338 KoColor c(QColor(src, src, src, srcAlpha), device->colorSpace());
339 src = device->colorSpace()->scaleToU8(c.data(), 0);
340 srcAlpha = device->colorSpace()->scaleToU8(c.data(), device->colorSpace()->alphaPos());
341
342 // Combine pixels
343 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
344
345 // Apply hardness
346 result = hardnessLut[result];
347
348 ChannelType *dstPixel = reinterpret_cast<ChannelType*>(dstIterator.rawData());
349 ChannelType channelMin = static_cast<ChannelType>(channelInfo->getUIMin());
350 ChannelType channelMax = static_cast<ChannelType>(channelInfo->getUIMax());
351 dstPixel[channelPos] = static_cast<ChannelType>(mapU8ToRange(255 - result, channelMin, channelMax));
352 }
353 } else {
354 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
355 int dst = device->colorSpace()->scaleToU8(dstIterator.rawData(), channelPos);
356 int src = srcIterator.rawData()[0];
357 int srcAlpha = srcIterator.rawData()[1];
358 KoColor c(QColor(src, src, src, srcAlpha), device->colorSpace());
359 src = device->colorSpace()->scaleToU8(c.data(), 0);
360 srcAlpha = device->colorSpace()->scaleToU8(c.data(), device->colorSpace()->alphaPos());
361
362 // Combine pixels
363 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
364
365 // Apply hardness
366 result = hardnessLut[result];
367
368 ChannelType *dstPixel = reinterpret_cast<ChannelType*>(dstIterator.rawData());
369 ChannelType channelMin = static_cast<ChannelType>(channelInfo->getUIMin());
370 ChannelType channelMax = static_cast<ChannelType>(channelInfo->getUIMax());
371 dstPixel[channelPos] = static_cast<ChannelType>(mapU8ToRange(result, channelMin, channelMax));
372 }
373 }
374 } else {
375 if (!invert) {
376 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
377 int dst = 255 - device->colorSpace()->scaleToU8(dstIterator.rawData(), channelPos);
378 int src = srcIterator.rawData()[0];
379 int srcAlpha = srcIterator.rawData()[1];
380
381 // Combine pixels
382 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
383
384 // Apply hardness
385 result = hardnessLut[result];
386
387 ChannelType *dstPixel = reinterpret_cast<ChannelType*>(dstIterator.rawData());
388 ChannelType channelMin = static_cast<ChannelType>(channelInfo->getUIMin());
389 ChannelType channelMax = static_cast<ChannelType>(channelInfo->getUIMax());
390 dstPixel[channelPos] = static_cast<ChannelType>(mapU8ToRange(255 - result, channelMin, channelMax));
391 }
392 } else {
393 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
394 int dst = device->colorSpace()->scaleToU8(dstIterator.rawData(), channelPos);
395 int src = srcIterator.rawData()[0];
396 int srcAlpha = srcIterator.rawData()[1];
397
398 // Combine pixels
399 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] * srcAlpha / 0xFE01, 255);
400
401 // Apply hardness
402 result = hardnessLut[result];
403
404 ChannelType *dstPixel = reinterpret_cast<ChannelType*>(dstIterator.rawData());
405 ChannelType channelMin = static_cast<ChannelType>(channelInfo->getUIMin());
406 ChannelType channelMax = static_cast<ChannelType>(channelInfo->getUIMax());
407 dstPixel[channelPos] = static_cast<ChannelType>(mapU8ToRange(result, channelMin, channelMax));
408 }
409 }
410 }
411}
static quint8 mapU8ToRange(quint8 value, quint8 new_min, quint8 new_max)
qint32 pos() const
double getUIMin(void) const
double getUIMax(void) const
virtual quint32 alphaPos() const =0
virtual quint8 scaleToU8(const quint8 *srcPixel, qint32 channelPos) const =0
virtual const KoColorProfile * profile() const =0
virtual bool isLinear() const =0

References KoColorSpace::alphaPos(), KisPaintDevice::colorSpace(), KoColor::data(), KoChannelInfo::getUIMax(), KoChannelInfo::getUIMin(), KisHalftoneFilterConfiguration::hardness(), KisHalftoneFilterConfiguration::invert(), KoColorProfile::isLinear(), makeHardnessLut(), makeNoiseWeightLut(), mapU8ToRange(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KoChannelInfo::pos(), KoColorSpace::profile(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KoColorSpace::scaleToU8().

◆ processChannels()

void KisHalftoneFilter::processChannels ( KisPaintDeviceSP device,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
KoUpdater * progressUpdater ) const
private

Definition at line 413 of file KisHalftoneFilter.cpp.

417{
418 const QList<KoChannelInfo *> channels = device->colorSpace()->channels();
419 const int progressStep = 100 / (channels.count() * 2);
420
421 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 0)) {
422 return;
423 }
424
425 // Make the generator devices
426 QVector<KisPaintDeviceSP> generatorDevices(channels.count());
427 for (int i = 0; i < channels.count(); ++i) {
428 if (channels.at(i)->channelType() == KoChannelInfo::ALPHA) {
429 generatorDevices[i] = nullptr;
430 } else {
431 const QString prefix =
432 device->colorSpace()->colorModelId().id() + "_channel" + QString::number(i) + "_";
433 KisPaintDeviceSP generatorDevice = makeGeneratorPaintDevice(device, prefix, applyRect, config, nullptr);
434 if (generatorDevice) {
435 generatorDevices[i] = generatorDevice;
436 } else {
437 generatorDevices[i] = nullptr;
438 }
439 }
440 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, progressUpdater->progress() + progressStep)) {
441 return;
442 }
443 }
444
445 // process channels
446 for (int i = 0; i < channels.count(); ++i) {
447 if (!generatorDevices[i]) {
448 progressUpdater->setProgress(progressUpdater->progress() + progressStep);
449 continue;
450 }
451
452 const QString prefix = device->colorSpace()->colorModelId().id() + "_channel" + QString::number(i) + "_";
453
454 switch (channels.at(i)->channelValueType()) {
456 processChannel<quint8>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
457 break;
458 } case KoChannelInfo::UINT16: {
459 processChannel<quint16>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
460 break;
461 } case KoChannelInfo::UINT32: {
462 processChannel<quint32>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
463 break;
464 } case KoChannelInfo::FLOAT16: {
465#ifdef HAVE_OPENEXR
466 processChannel<half>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
467#endif
468 break;
469 } case KoChannelInfo::FLOAT32: {
470 processChannel<float>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
471 break;
472 } case KoChannelInfo::FLOAT64: {
473 processChannel<double>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
474 break;
475 } case KoChannelInfo::INT8: {
476 processChannel<qint8>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
477 break;
478 } case KoChannelInfo::INT16: {
479 processChannel<qint16>(device, generatorDevices[i], applyRect, config, prefix, channels.at(i));
480 break;
481 } default: {
482 break;
483 }
484 }
485
486 m_grayDevicesCache.putDevice(generatorDevices[i]);
487
488 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, progressUpdater->progress() + progressStep)) {
489 return;
490 }
491 }
492
493 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 100)) {
494 return;
495 }
496}
@ ALPHA
The channel represents the opacity of a pixel.
@ UINT8
use this for an unsigned integer 8bits channel
@ UINT16
use this for an integer 16bits channel
@ INT16
use this for an integer 16bits channel
@ INT8
use this for an integer 8bits channel
@ FLOAT32
use this for a float 32bits channel
@ FLOAT16
use this for a float 16bits channel
@ UINT32
use this for an unsigned integer 21bits channel
@ FLOAT64
use this for a float 64bits channel
QList< KoChannelInfo * > channels
virtual KoID colorModelId() const =0
QString id() const
Definition KoID.cpp:63
int progress() const
Definition KoUpdater.cpp:48

References KoChannelInfo::ALPHA, KoColorSpace::channels, checkUpdaterInterruptedAndSetPercent(), KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KoChannelInfo::FLOAT16, KoChannelInfo::FLOAT32, KoChannelInfo::FLOAT64, KoID::id(), KoChannelInfo::INT16, KoChannelInfo::INT8, m_grayDevicesCache, makeGeneratorPaintDevice(), KoUpdater::progress(), KisCachedPaintDevice::putDevice(), KoUpdater::setProgress(), KoChannelInfo::UINT16, KoChannelInfo::UINT32, and KoChannelInfo::UINT8.

◆ processImpl()

void KisHalftoneFilter::processImpl ( KisPaintDeviceSP device,
const QRect & applyRect,
const KisFilterConfigurationSP config,
KoUpdater * progressUpdater ) const
overridevirtual

Override this function with the implementation of your filter.

This is a low level function that expects all the conditions for the

Parameters
devicebe met. Use usual process() methods instead.
devicethe paint device to filter
applyRectthe rectangle where the filter is applied
configthe parameters of the filter
progressUpdaterto pass on the progress the filter is making

Implements KisFilter.

Definition at line 48 of file KisHalftoneFilter.cpp.

52{
53 const KisHalftoneFilterConfiguration *filterConfig =
54 dynamic_cast<const KisHalftoneFilterConfiguration*>(config.data());
55
56 Q_ASSERT(device);
59
60 const QString mode = filterConfig->mode();
65 );
66
68 (device->colorSpace()->colorModelId().id() == AlphaColorModelID.id() &&
70 (device->colorSpace()->colorModelId().id() == GrayColorModelID.id() &&
72 (device->colorSpace()->colorModelId().id() == GrayAColorModelID.id() &&
75 ((device->colorSpace()->colorModelId().id() == RGBAColorModelID.id() ||
76 device->colorSpace()->colorModelId().id() == XYZAColorModelID.id() ||
77 device->colorSpace()->colorModelId().id() == LABAColorModelID.id() ||
78 device->colorSpace()->colorModelId().id() == CMYKAColorModelID.id() ||
79 device->colorSpace()->colorModelId().id() == YCbCrAColorModelID.id()) &&
83 );
84
88 );
89 processIntensity(device, applyRect, filterConfig, progressUpdater);
92 device->colorSpace()->colorModelId().id() != AlphaColorModelID.id() &&
93 device->colorSpace()->colorModelId().id() != GrayColorModelID.id() &&
95 );
96 processChannels(device, applyRect, filterConfig, progressUpdater);
97 } else {
99 device->colorSpace()->colorModelId().id() != GrayColorModelID.id()
100 );
101 if (filterConfig->colorModelId() == AlphaColorModelID.id())
102 {
103 // This an Alpha layer (mask layer) but the device passed
104 // here has the composition color space (GrayA)
105 processMask(device, applyRect, filterConfig, progressUpdater);
106 } else {
107 // process the alpha channel of a multichannel device
108 processAlpha(device, applyRect, filterConfig, progressUpdater);
109 }
110 }
111}
const KoID YCbCrAColorModelID("YCbCrA", ki18n("YCbCr/Alpha"))
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID XYZAColorModelID("XYZA", ki18n("XYZ/Alpha"))
const KoID AlphaColorModelID("A", ki18n("Alpha mask"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
const KoID GrayColorModelID("GRAY", ki18n("Grayscale (without transparency)"))
static constexpr const char * HalftoneMode_Alpha
static constexpr const char * HalftoneMode_IndependentChannels
static constexpr const char * HalftoneMode_Intensity
void processIntensity(KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
void processChannels(KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
void processMask(KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
void processAlpha(KisPaintDeviceSP device, const QRect &applyRect, const KisHalftoneFilterConfiguration *config, KoUpdater *progressUpdater) const
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References AlphaColorModelID, CMYKAColorModelID, KisHalftoneFilterConfiguration::colorModelId(), KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KisSharedPtr< T >::data(), GrayAColorModelID, GrayColorModelID, KisHalftoneFilterConfiguration::HalftoneMode_Alpha, KisHalftoneFilterConfiguration::HalftoneMode_IndependentChannels, KisHalftoneFilterConfiguration::HalftoneMode_Intensity, KisFilterConfiguration::hasLocalResourcesSnapshot(), KoID::id(), KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, LABAColorModelID, KisHalftoneFilterConfiguration::mode(), processAlpha(), processChannels(), processIntensity(), processMask(), RGBAColorModelID, XYZAColorModelID, and YCbCrAColorModelID.

◆ processIntensity()

void KisHalftoneFilter::processIntensity ( KisPaintDeviceSP device,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
KoUpdater * progressUpdater ) const
private

Definition at line 189 of file KisHalftoneFilter.cpp.

193{
194 const QString prefix = "intensity_";
195
196 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 0)) {
197 return;
198 }
199
200 // Make the generator device
201 KisPaintDeviceSP generatorDevice = makeGeneratorPaintDevice(device, prefix, applyRect, config, nullptr);
202 if (!generatorDevice) {
203 return;
204 }
205 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 25)) {
206 return;
207 }
208
209 // Make the hardness and the noise weight LUT
210 const qreal hardness = config->hardness(prefix) / 100.0;
211 const QVector<quint8> hardnessLut = makeHardnessLut(hardness);
212 const QVector<quint8> noiseWeightLut = makeNoiseWeightLut(hardness);
213
214 // Fill the mask device
216
217 {
218 const bool invert = config->invert(prefix);
219
220 KisSequentialIterator maskIterator(maskDevice->pixelSelection(), applyRect);
221 KisSequentialIterator dstIterator(device, applyRect);
222 KisSequentialIterator srcIterator(generatorDevice, applyRect);
223
224 if (!invert) {
225 while (maskIterator.nextPixel() && dstIterator.nextPixel() && srcIterator.nextPixel()) {
226 int dstGray = device->colorSpace()->intensity8(dstIterator.rawData());
227 int srcGray = srcIterator.rawData()[0];
228 int srcAlpha = srcIterator.rawData()[1];
229
230 // Combine pixels
231 int result = qBound(0, dstGray + (srcGray - 128) * noiseWeightLut[dstGray] * srcAlpha / 0xFE01, 255);
232
233 // Apply hardness
234 result = hardnessLut[result];
235
236 *maskIterator.rawData() = 255 - result;
237 }
238 } else {
239 while (maskIterator.nextPixel() && dstIterator.nextPixel() && srcIterator.nextPixel()) {
240 int dstGray = device->colorSpace()->intensity8(dstIterator.rawData());
241 int srcGray = srcIterator.rawData()[0];
242 int srcAlpha = srcIterator.rawData()[1];
243
244 // Combine pixels
245 int result = qBound(0, dstGray + (srcGray - 128) * noiseWeightLut[dstGray] * srcAlpha / 0xFE01, 255);
246
247 // Apply hardness
248 result = hardnessLut[result];
249
250 *maskIterator.rawData() = result;
251 }
252 }
253 m_grayDevicesCache.putDevice(generatorDevice);
254 }
255 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 50)) {
256 return;
257 }
258
259 // Make the halftone image
260 const KoColorSpace *colorSpace;
261 if (device->colorSpace()->profile()->isLinear()) {
262 colorSpace = KoColorSpaceRegistry::instance()->rgb8();
263 } else {
264 colorSpace = device->colorSpace();
265 }
266 KisPaintDeviceSP halftoneDevice = m_genericDevicesCache.getDevice(device, colorSpace);
267
268 {
269 KisPaintDeviceSP foregroundDevice = m_genericDevicesCache.getDevice(device, colorSpace);
270 KoColor foregroundColor = config->foregroundColor(prefix);
271 KoColor backgroundColor = config->backgroundColor(prefix);
272 const qreal foregroundOpacity = config->foregroundOpacity(prefix) / 100.0;
273 const qreal backgroundOpacity = config->backgroundOpacity(prefix) / 100.0;
274 foregroundColor.convertTo(colorSpace);
275 backgroundColor.convertTo(colorSpace);
276 foregroundColor.setOpacity(foregroundOpacity);
277 backgroundColor.setOpacity(backgroundOpacity);
278
279 foregroundDevice->fill(applyRect, foregroundColor);
280 halftoneDevice->fill(applyRect, backgroundColor);
281
282 KisPainter painter(halftoneDevice, maskDevice);
283 painter.setCompositeOpId(COMPOSITE_OVER);
284 painter.bitBlt(applyRect.topLeft(), foregroundDevice, applyRect);
285
286 m_genericDevicesCache.putDevice(foregroundDevice);
288 }
289 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 75)) {
290 return;
291 }
292
293 // Make the final image
294 {
295 KisPainter painter(halftoneDevice);
296 painter.setCompositeOpId(COMPOSITE_DESTINATION_IN);
297 painter.bitBlt(applyRect.topLeft(), device, applyRect);
298 }
299 {
300 KisPainter painter(device);
301 painter.setCompositeOpId(COMPOSITE_COPY);
302 painter.bitBlt(applyRect.topLeft(), halftoneDevice, applyRect);
303 }
304 m_genericDevicesCache.putDevice(halftoneDevice);
305
306 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 100)) {
307 return;
308 }
309}
const QString COMPOSITE_OVER
const QString COMPOSITE_COPY
const QString COMPOSITE_DESTINATION_IN
void putSelection(KisSelectionSP selection)
KisSelectionSP getSelection()
KoColor backgroundColor(const QString &prefix) const
int backgroundOpacity(const QString &prefix) const
int foregroundOpacity(const QString &prefix) const
KoColor foregroundColor(const QString &prefix) const
KisCachedPaintDevice m_genericDevicesCache
KisCachedSelection m_selectionsCache
void fill(const QRect &rc, const KoColor &color)
virtual quint8 intensity8(const quint8 *src) const =0
void convertTo(const KoColorSpace *cs, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
Definition KoColor.cpp:136
void setOpacity(quint8 alpha)
Definition KoColor.cpp:333
KisPixelSelectionSP pixelSelection
const KoColorSpace * rgb8(const QString &profileName=QString())

References KisHalftoneFilterConfiguration::backgroundColor(), KisHalftoneFilterConfiguration::backgroundOpacity(), KisPainter::bitBlt(), checkUpdaterInterruptedAndSetPercent(), KisPaintDevice::colorSpace(), COMPOSITE_COPY, COMPOSITE_DESTINATION_IN, COMPOSITE_OVER, KoColor::convertTo(), KisPaintDevice::fill(), KisHalftoneFilterConfiguration::foregroundColor(), KisHalftoneFilterConfiguration::foregroundOpacity(), KisCachedPaintDevice::getDevice(), KisCachedSelection::getSelection(), KisHalftoneFilterConfiguration::hardness(), KoColorSpaceRegistry::instance(), KoColorSpace::intensity8(), KisHalftoneFilterConfiguration::invert(), KoColorProfile::isLinear(), m_genericDevicesCache, m_grayDevicesCache, m_selectionsCache, makeGeneratorPaintDevice(), makeHardnessLut(), makeNoiseWeightLut(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSelection::pixelSelection, KoColorSpace::profile(), KisCachedPaintDevice::putDevice(), KisCachedSelection::putSelection(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KoColorSpaceRegistry::rgb8(), KisPainter::setCompositeOpId(), and KoColor::setOpacity().

◆ processMask()

void KisHalftoneFilter::processMask ( KisPaintDeviceSP device,
const QRect & applyRect,
const KisHalftoneFilterConfiguration * config,
KoUpdater * progressUpdater ) const
private

Definition at line 564 of file KisHalftoneFilter.cpp.

568{
569 const QString prefix = "alpha_";
570
571 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 0)) {
572 return;
573 }
574
575 // Make the generator device
576 KisPaintDeviceSP generatorDevice = makeGeneratorPaintDevice(device, prefix, applyRect, config, nullptr);
577 if (!generatorDevice) {
578 return;
579 }
580 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 50)) {
581 return;
582 }
583
584 // Make the hardness and the noise weight LUT
585 const qreal hardness = config->hardness(prefix) / 100.0;
586 const QVector<quint8> hardnessLut = makeHardnessLut(hardness);
587 const QVector<quint8> noiseWeightLut = makeNoiseWeightLut(hardness);
588
589 // Fill the device
590 const bool invert = config->invert(prefix);
591 KisSequentialIterator dstIterator(device, applyRect);
592 KisSequentialIterator srcIterator(generatorDevice, applyRect);
593
594 if (!invert) {
595 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
596 int dst = 255 - *dstIterator.rawData();
597 int src = *srcIterator.rawData();
598
599 // Combine pixels
600 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] / 0xFF, 255);
601
602 // Apply hardness
603 result = hardnessLut[result];
604
605 *dstIterator.rawData() = static_cast<quint8>(255 - result);
606 }
607 } else {
608 while (dstIterator.nextPixel() && srcIterator.nextPixel()) {
609 int dst = *dstIterator.rawData();
610 int src = *srcIterator.rawData();
611
612 // Combine pixels
613 int result = qBound(0, dst + (src - 128) * noiseWeightLut[dst] / 0xFF, 255);
614
615 // Apply hardness
616 result = hardnessLut[result];
617
618 *dstIterator.rawData() = static_cast<quint8>(result);
619 }
620 }
621 m_grayDevicesCache.putDevice(generatorDevice);
622
623 if (checkUpdaterInterruptedAndSetPercent(progressUpdater, 100)) {
624 return;
625 }
626}

References checkUpdaterInterruptedAndSetPercent(), KisHalftoneFilterConfiguration::hardness(), KisHalftoneFilterConfiguration::invert(), m_grayDevicesCache, makeGeneratorPaintDevice(), makeHardnessLut(), makeNoiseWeightLut(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisCachedPaintDevice::putDevice(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData().

Member Data Documentation

◆ m_genericDevicesCache

KisCachedPaintDevice KisHalftoneFilter::m_genericDevicesCache
mutableprivate

Definition at line 52 of file KisHalftoneFilter.h.

◆ m_grayDevicesCache

KisCachedPaintDevice KisHalftoneFilter::m_grayDevicesCache
mutableprivate

Definition at line 51 of file KisHalftoneFilter.h.

◆ m_selectionsCache

KisCachedSelection KisHalftoneFilter::m_selectionsCache
mutableprivate

Definition at line 50 of file KisHalftoneFilter.h.


The documentation for this class was generated from the following files: