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

#include <kis_polygonal_gradient_shape_strategy.h>

+ Inheritance diagram for KisPolygonalGradientShapeStrategy:

Public Member Functions

 KisPolygonalGradientShapeStrategy (const QPainterPath &selectionPath, qreal exponent)
 
double valueAt (double x, double y) const override
 
 ~KisPolygonalGradientShapeStrategy () override
 
- Public Member Functions inherited from KisGradientShapeStrategy
 KisGradientShapeStrategy ()
 
 KisGradientShapeStrategy (const QPointF &gradientVectorStart, const QPointF &gradientVectorEnd)
 
virtual ~KisGradientShapeStrategy ()
 

Static Public Member Functions

static QPointF testingCalculatePathCenter (int numSamples, const QPainterPath &path, qreal exponent, bool searchForMax)
 

Private Attributes

qreal m_exponent
 
qreal m_maxWeight
 
qreal m_minWeight
 
qreal m_scaleCoeff
 
QPainterPath m_selectionPath
 

Additional Inherited Members

- Protected Attributes inherited from KisGradientShapeStrategy
QPointF m_gradientVectorEnd
 
QPointF m_gradientVectorStart
 

Detailed Description

Definition at line 17 of file kis_polygonal_gradient_shape_strategy.h.

Constructor & Destructor Documentation

◆ KisPolygonalGradientShapeStrategy()

KisPolygonalGradientShapeStrategy::KisPolygonalGradientShapeStrategy ( const QPainterPath & selectionPath,
qreal exponent )

◆ ~KisPolygonalGradientShapeStrategy()

KisPolygonalGradientShapeStrategy::~KisPolygonalGradientShapeStrategy ( )
override

Definition at line 369 of file kis_polygonal_gradient_shape_strategy.cpp.

370{
371}

Member Function Documentation

◆ testingCalculatePathCenter()

QPointF KisPolygonalGradientShapeStrategy::testingCalculatePathCenter ( int numSamples,
const QPainterPath & path,
qreal exponent,
bool searchForMax )
static

Definition at line 386 of file kis_polygonal_gradient_shape_strategy.cpp.

387{
388 QPointF result;
389
390 qreal extremumValue = Private::initialExtremumValue(searchForMax);
391 bool success = Private::findBestStartingPoint(numSamples, path,
392 exponent, searchForMax,
393 extremumValue,
394 &result);
395
396 if (!success) {
397 dbgKrita << "WARNING: Couldn't calculate findBestStartingPoint for:";
398 dbgKrita << ppVar(numSamples);
399 dbgKrita << ppVar(exponent);
400 dbgKrita << ppVar(searchForMax);
401 dbgKrita << ppVar(path);
402
403 }
404
405 return result;
406}
#define dbgKrita
Definition kis_debug.h:45
#define ppVar(var)
Definition kis_debug.h:155
bool findBestStartingPoint(int numSamples, const QPainterPath &path, qreal exponent, bool searchForMax, qreal initialExtremumValue, QPointF *result)
qreal initialExtremumValue(bool searchForMax)

References dbgKrita, Private::findBestStartingPoint(), Private::initialExtremumValue(), and ppVar.

◆ valueAt()

double KisPolygonalGradientShapeStrategy::valueAt ( double x,
double y ) const
overridevirtual

Implements KisGradientShapeStrategy.

Definition at line 373 of file kis_polygonal_gradient_shape_strategy.cpp.

374{
375 QPointF pt(x, y);
376 qreal value = 0.0;
377
378 if (m_selectionPath.contains(pt)) {
381 }
382
383 return value;
384}
float value(const T *src, size_t ch)
qreal getDisnormedGradientValue(const QPointF &pt, const QPainterPath &selectionPath, qreal exponent)

References Private::getDisnormedGradientValue(), m_exponent, m_minWeight, m_scaleCoeff, m_selectionPath, and value().

Member Data Documentation

◆ m_exponent

qreal KisPolygonalGradientShapeStrategy::m_exponent
private

Definition at line 31 of file kis_polygonal_gradient_shape_strategy.h.

◆ m_maxWeight

qreal KisPolygonalGradientShapeStrategy::m_maxWeight
private

Definition at line 33 of file kis_polygonal_gradient_shape_strategy.h.

◆ m_minWeight

qreal KisPolygonalGradientShapeStrategy::m_minWeight
private

Definition at line 32 of file kis_polygonal_gradient_shape_strategy.h.

◆ m_scaleCoeff

qreal KisPolygonalGradientShapeStrategy::m_scaleCoeff
private

Definition at line 34 of file kis_polygonal_gradient_shape_strategy.h.

◆ m_selectionPath

QPainterPath KisPolygonalGradientShapeStrategy::m_selectionPath
private

Definition at line 29 of file kis_polygonal_gradient_shape_strategy.h.


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