Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_gradient_painter.cc File Reference
#include "kis_gradient_painter.h"
#include <algorithm>
#include <cfloat>
#include <KoColorSpace.h>
#include <resources/KoAbstractGradient.h>
#include <KoUpdater.h>
#include <KoColorModelStandardIds.h>
#include <KoColorSpaceRegistry.h>
#include "kis_global.h"
#include "kis_paint_device.h"
#include <resources/KoPattern.h>
#include "kis_selection.h"
#include <KisSequentialIteratorProgress.h>
#include "kis_image.h"
#include "kis_random_accessor_ng.h"
#include "kis_gradient_shape_strategy.h"
#include "kis_polygonal_gradient_shape_strategy.h"
#include "kis_cached_gradient_shape_strategy.h"
#include "krita_utils.h"
#include "KoMixColorsOp.h"
#include <KisDitherMaths.h>
#include <KisDitherOp.h>
#include <KoCachedGradient.h>

Go to the source code of this file.

Classes

class  KisGradientPainter
 
struct  KisGradientPainter::ProcessRegion
 

Functions

KisGradientShapeStrategy * createPolygonShapeStrategy (const QPainterPath &path, const QRect &boundingRect)
 

Function Documentation

◆ createPolygonShapeStrategy()

KisGradientShapeStrategy * createPolygonShapeStrategy ( const QPainterPath & path,
const QRect & boundingRect )

Definition at line 1089 of file kis_gradient_painter.cc.

1090{
1091 // TODO: implement UI for exponent option
1092 const qreal exponent = 2.0;
1093 KisGradientShapeStrategy *strategy =
1094 new KisPolygonalGradientShapeStrategy(path, exponent);
1095
1096 KIS_ASSERT_RECOVER_NOOP(boundingRect.width() >= 3 &&
1097 boundingRect.height() >= 3);
1098
1099 const qreal step =
1100 qMin(qreal(8.0), KritaUtils::maxDimensionPortion(boundingRect, 0.01, 2));
1101
1102 return new KisCachedGradientShapeStrategy(boundingRect, step, step, strategy);
1103}
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97
qreal KRITAIMAGE_EXPORT maxDimensionPortion(const QRectF &bounds, qreal portion, qreal minValue)

References KIS_ASSERT_RECOVER_NOOP, and KritaUtils::maxDimensionPortion().