7#ifndef _DEFORM_BRUSH_H_
8#define _DEFORM_BRUSH_H_
19#if defined(_WIN32) || defined(_WIN64)
21inline double drand48()
23 return double(rand()) / RAND_MAX;
37 Q_UNUSED(randomSource);
53 Q_UNUSED(randomSource);
55 *x = *x / scaleFactor;
56 *y = *y / scaleFactor;
72 Q_UNUSED(randomSource);
97 Q_UNUSED(randomSource);
126 Q_UNUSED(randomSource);
128 qreal normX = *maskX /
m_maxX;
129 qreal normY = *maskY /
m_maxY;
131 qreal radius_2 = normX * normX + normY * normY;
132 qreal radius_4 = radius_2 * radius_2;
135 *maskX = normX * (1.0 +
m_k1 * radius_2 +
m_k2 * radius_4);
136 *maskY = normY * (1.0 +
m_k1 * radius_2 +
m_k2 * radius_4);
139 *maskX = normX / (1.0 +
m_k1 * radius_2 +
m_k2 * radius_4);
140 *maskY = normY / (1.0 +
m_k1 * radius_2 +
m_k2 * radius_4);
143 *maskX =
m_maxX * (*maskX);
144 *maskY =
m_maxY * (*maskY);
187 qreal scale, qreal rotation, QPointF pos,
188 qreal subPixelX, qreal subPixelY,
int dabX,
int dabY);
197 QPointF
hotSpot(qreal scale, qreal rotation);
202 DeformModes mode,
const QPointF& pos, QTransform
const& rotation);
213 inline qreal
norme(qreal x, qreal y) {
214 return x * x + y * y;
qreal distance(const QPointF &p1, const QPointF &p2)
qreal generateNormalized() const