17#include "ui_wdgblur.h"
43 config->setProperty(
"lockAspect",
true);
44 config->setProperty(
"halfWidth", 5);
45 config->setProperty(
"halfHeight", 5);
46 config->setProperty(
"rotate", 0);
47 config->setProperty(
"strength", 0);
48 config->setProperty(
"shape", 0);
58 QPoint srcTopLeft =
rect.topLeft();
59 Q_ASSERT(device != 0);
65 const uint halfWidth = t.
scale((config->getProperty(
"halfWidth",
value)) ?
value.toUInt() : 5);
66 const uint halfHeight = t.
scale((config->getProperty(
"halfHeight",
value)) ?
value.toUInt() : 5);
68 int shape = (config->getProperty(
"shape",
value)) ?
value.toInt() : 0;
69 uint width = 2 * halfWidth + 1;
70 uint height = 2 * halfHeight + 1;
71 qreal aspectRatio = (qreal) height / width;
72 int rotate = (config->getProperty(
"rotate",
value)) ?
value.toInt() : 0;
73 qreal strength = (config->getProperty(
"strength",
value) ?
value.toUInt() : 0) / (qreal) 100;
74 qreal hFade = strength;
75 qreal vFade = strength;
88 QBitArray channelFlags;
90 channelFlags = config->channelFlags();
92 if (channelFlags.isEmpty() || !config) {
110 const int halfWidth = t.
scale(_config->getProperty(
"halfWidth",
value) ?
value.toUInt() : 5);
111 const int halfHeight = t.
scale(_config->getProperty(
"halfHeight",
value) ?
value.toUInt() : 5);
113 return rect.adjusted(-halfWidth * 2, -halfHeight * 2, halfWidth * 2, halfHeight * 2);
121 const int halfWidth = t.
scale(_config->getProperty(
"halfWidth",
value) ?
value.toUInt() : 5);
122 const int halfHeight = t.
scale(_config->getProperty(
"halfHeight",
value) ?
value.toUInt() : 5);
124 return rect.adjusted(-halfWidth, -halfHeight, halfWidth, halfHeight);
float value(const T *src, size_t ch)
QRect changedRect(const QRect &rect, const KisFilterConfigurationSP _config, int lod) const override
KisFilterConfigurationSP defaultConfiguration(KisResourcesInterfaceSP resourcesInterface) const override
KisConfigWidget * createConfigurationWidget(QWidget *parent, const KisPaintDeviceSP dev, bool useForMasks) const override
void processImpl(KisPaintDeviceSP device, const QRect &size, const KisFilterConfigurationSP config, KoUpdater *progressUpdater) const override
QRect neededRect(const QRect &rect, const KisFilterConfigurationSP _config, int lod) const override
The KisConvolutionPainter class applies a convolution kernel to a paint device.
void applyMatrix(const KisConvolutionKernelSP kernel, const KisPaintDeviceSP src, QPoint srcPos, QPoint dstPos, QSize areaSize, KisConvolutionBorderOp borderOp=BORDER_REPEAT)
void setSupportsLevelOfDetail(bool value)
const KoColorSpace * colorSpace() const
void setProgress(KoUpdater *progressUpdater)
void setChannelFlags(QBitArray channelFlags)
virtual quint32 channelCount() const =0
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
const KoID FiltersCategoryBlurId("blur_filters", ki18nc("The category of blur filters, like gaussian blur. Verb.", "Blur"))
virtual KisFilterConfigurationSP factoryConfiguration(KisResourcesInterfaceSP resourcesInterface) const
void setSupportsAdjustmentLayers(bool v)
void setSupportsPainting(bool v)
void setColorSpaceIndependence(ColorSpaceIndependence v)
static KisConvolutionKernelSP fromMaskGenerator(KisMaskGenerator *, qreal angle=0.0)