#include <kis_convolution_kernel.h>
Definition at line 14 of file kis_convolution_kernel.cc.
◆ KisConvolutionKernel()
| KisConvolutionKernel::KisConvolutionKernel |
( |
quint32 | width, |
|
|
quint32 | height, |
|
|
qreal | offset, |
|
|
qreal | factor ) |
◆ ~KisConvolutionKernel()
| KisConvolutionKernel::~KisConvolutionKernel |
( |
| ) |
|
|
virtual |
◆ data() [1/2]
| Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > & KisConvolutionKernel::data |
( |
| ) |
|
◆ data() [2/2]
| const Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > * KisConvolutionKernel::data |
( |
| ) |
const |
◆ factor()
| qreal KisConvolutionKernel::factor |
( |
| ) |
const |
◆ fromMaskGenerator()
Definition at line 94 of file kis_convolution_kernel.cc.
95{
96 Q_UNUSED(angle);
97
100
102
103 qreal cosa = cos(angle);
104 qreal sina =
sin(angle);
105 qreal xc = 0.5 *
width - 0.5;
106 qreal yc = 0.5 *
height - 0.5;
107
108 Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic>&
data = kernel->
data();
110
111
113 for (
int c = 0; c <
width; ++c) {
114 qreal x_ = (c - xc);
116 qreal
x = cosa * x_ - sina * y_;
117 qreal
y = sina * x_ + cosa * y_;
118
122 }
123 }
125 return kernel;
126}
float value(const T *src, size_t ch)
virtual quint8 valueAt(qreal x, qreal y) const =0
KisConvolutionKernel(quint32 width, quint32 height, qreal offset, qreal factor)
Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > data
References data, factor, KisMaskGenerator::height(), height(), KisConvolutionKernel(), setFactor(), value(), KisMaskGenerator::valueAt(), KisMaskGenerator::width(), and width().
◆ fromMatrix()
| KisConvolutionKernelSP KisConvolutionKernel::fromMatrix |
( |
Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > | matrix, |
|
|
qreal | offset, |
|
|
qreal | factor ) |
|
static |
◆ fromQImage()
Definition at line 73 of file kis_convolution_kernel.cc.
74{
76
77 Eigen::Matrix<qreal, Eigen::Dynamic, Eigen::Dynamic>&
data = kernel->
data();
78 const quint8* itImage = image.constBits();
80
81 for (
int r = 0;
r < image.height();
r++) {
82 for (int c = 0; c < image.width(); c++, itImage += 4)
83 {
84 uint value = 255 - (*itImage + *(itImage + 1) + *(itImage + 2)) / 3;
87 }
88 }
89
91 return kernel;
92}
References data, factor, KisConvolutionKernel(), setFactor(), and value().
◆ height()
| quint32 KisConvolutionKernel::height |
( |
| ) |
const |
◆ offset()
| qreal KisConvolutionKernel::offset |
( |
| ) |
const |
◆ setFactor()
| void KisConvolutionKernel::setFactor |
( |
qreal | factor | ) |
|
◆ setSize()
| void KisConvolutionKernel::setSize |
( |
quint32 | width, |
|
|
quint32 | height ) |
Change the size of a kernel, it won't reallocate, and therefore it must keep the same kernel size ( oldwidth * oldheight = newwidth*newheight)
Definition at line 42 of file kis_convolution_kernel.cc.
References d, height(), and width().
◆ width()
| quint32 KisConvolutionKernel::width |
( |
| ) |
const |
| Private* const KisConvolutionKernel::d |
|
private |
◆ data
| const Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > * KisConvolutionKernel::data |
◆ factor
| qreal KisConvolutionKernel::factor |
◆ offset
| qreal KisConvolutionKernel::offset |
The documentation for this class was generated from the following files: