|
Krita Source Code Documentation
|
#include <kis_paintop.h>
Inheritance diagram for KisPaintOp:Public Member Functions | |
| virtual bool | canPaint () const |
| virtual std::pair< int, bool > | doAsynchronousUpdate (QVector< KisRunnableStrokeJobData * > &jobs) |
| KisPaintOp (KisPainter *painter) | |
| void | paintAt (const KisPaintInformation &info, KisDistanceInformation *currentDistance) |
| virtual void | paintBezierCurve (const KisPaintInformation &pi1, const QPointF &control1, const QPointF &control2, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) |
| virtual void | paintLine (const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) |
| Private (KisPaintOp *_q) | |
| void | updateSpacing (const KisPaintInformation &info, KisDistanceInformation ¤tDistance) const |
| void | updateTiming (const KisPaintInformation &info, KisDistanceInformation ¤tDistance) const |
| virtual | ~KisPaintOp () |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Public Member Functions inherited from KisShared | |
| bool | deref () |
| bool | ref () |
| int | refCount () |
| QAtomicInt * | sharedWeakReference () |
Static Public Member Functions | |
| static void | splitCoordinate (qreal coordinate, qint32 *whole, qreal *fraction) |
Public Attributes | |
| KisFixedPaintDeviceSP | dab |
| bool | fanCornersEnabled {false} |
| qreal | fanCornersStep {1.0} |
| KisPainter * | painter {nullptr} |
| KisPaintOp * | q {nullptr} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Protected Member Functions | |
| KisFixedPaintDeviceSP | cachedDab () |
| KisFixedPaintDeviceSP | cachedDab (const KoColorSpace *cs) |
| virtual KisSpacingInformation | paintAt (const KisPaintInformation &info)=0 |
| KisPainter * | painter () const |
| KisPaintDeviceSP | source () const |
| virtual KisSpacingInformation | updateSpacingImpl (const KisPaintInformation &info) const =0 |
| virtual KisTimingInformation | updateTimingImpl (const KisPaintInformation &info) const |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Private Member Functions | |
| void | setFanCornersInfo (bool fanCornersEnabled, qreal fanCornersStep) |
Private Attributes | |
| Private *const | d {nullptr} |
Friends | |
| class | KisPaintInformation |
| class | KisRotationOption |
KisPaintOp are use by tools to draw on a paint device. A paintop takes settings and input information, like pressure, tilt or motion and uses that to draw pixels
Definition at line 39 of file kis_paintop.cc.
| KisPaintOp::KisPaintOp | ( | KisPainter * | painter | ) |
Definition at line 53 of file kis_paintop.cc.
|
virtual |
|
protected |
|
protected |
|
inlinevirtual |
Whether this paintop can paint. Can be false in case that some setting isn't read correctly.
Reimplemented in KisBrushBasedPaintOp.
Definition at line 94 of file kis_paintop.h.
|
virtual |
If the preset supports asynchronous updates, then the stroke execution core will call this method with a desired frame rate. The jobs that should be run to prepare the update are returned via jobs
Reimplemented in KisBrushOp.
Definition at line 92 of file kis_paintop.cc.
|
protectedpure virtual |
The implementation of painting of a dab and updating spacing. This does NOT need to update the timing information.
Implemented in KisColorSmudgeOp, KisCurvePaintOp, KisBrushOp, KisDuplicateOp, KisDeformPaintOp, KisExperimentPaintOp, KisFilterOp, KisGridPaintOp, KisHairyPaintOp, KisHatchingPaintOp, KisMyPaintPaintOp, KisParticlePaintOp, KisRoundMarkerOp, KisSketchPaintOp, KisSprayPaintOp, and KisTangentNormalPaintOp.
| void KisPaintOp::paintAt | ( | const KisPaintInformation & | info, |
| KisDistanceInformation * | currentDistance ) |
Paint at the subpixel point pos using the specified paint information..
The distance/time between two calls of the paintAt is always specified by spacing and timing, which are automatically saved into the current distance information object.
Definition at line 148 of file kis_paintop.cc.
References KisPaintInformation::paintAt().
|
virtual |
Draw a Bezier curve between pos1 and pos2 using control points 1 and 2. If savedDist is less than zero, the brush is painted at pos1 before being painted along the curve using the spacing setting.
Definition at line 129 of file kis_paintop.cc.
References toKisVector2D().
|
protected |
Return the painter this paintop is owned by
|
virtual |
Draw a line between pos1 and pos2 using the currently set brush and color. If savedDist is less than zero, the brush is painted at pos1 before being painted along the line using the spacing setting.
Reimplemented in KisCurvePaintOp, KisBrushOp, KisExperimentPaintOp, KisHairyPaintOp, KisParticlePaintOp, KisSketchPaintOp, and KisTangentNormalPaintOp.
Definition at line 139 of file kis_paintop.cc.
References d, and KisPaintOpUtils::paintLine().
|
inline |
Definition at line 40 of file kis_paintop.cc.
|
private |
Definition at line 77 of file kis_paintop.cc.
References d, fanCornersEnabled, and fanCornersStep.
|
protected |
Return the paintdevice the painter this paintop is owned by
Definition at line 194 of file kis_paintop.cc.
References d.
|
static |
Split the coordinate into whole + fraction, where fraction is always >= 0.
Definition at line 83 of file kis_paintop.cc.
| void KisPaintOp::updateSpacing | ( | const KisPaintInformation & | info, |
| KisDistanceInformation & | currentDistance ) const |
Updates the spacing settings in currentDistance based on the provided information. Note that the spacing is updated automatically in the paintAt method, so there is no need to call this method if paintAt has just been called.
Definition at line 155 of file kis_paintop.cc.
References KisPaintInformation::registerDistanceInformation(), KisDistanceInformation::updateSpacing(), and updateSpacingImpl().
|
protectedpure virtual |
Implementation of a spacing update
Implemented in KisColorSmudgeOp, KisCurvePaintOp, KisBrushOp, KisDuplicateOp, KisDeformPaintOp, KisExperimentPaintOp, KisFilterOp, KisGridPaintOp, KisHairyPaintOp, KisHatchingPaintOp, KisMyPaintPaintOp, KisParticlePaintOp, KisRoundMarkerOp, KisSketchPaintOp, KisSprayPaintOp, and KisTangentNormalPaintOp.
| void KisPaintOp::updateTiming | ( | const KisPaintInformation & | info, |
| KisDistanceInformation & | currentDistance ) const |
Updates the timing settings in currentDistance based on the provided information. Note that the timing is updated automatically in the paintAt method, so there is no need to call this method if paintAt has just been called.
Definition at line 169 of file kis_paintop.cc.
References KisPaintInformation::registerDistanceInformation(), KisDistanceInformation::updateTiming(), and updateTimingImpl().
|
protectedvirtual |
Implementation of a timing update. The default implementation always disables timing. This is suitable for paintops that do not support airbrushing.
Reimplemented in KisColorSmudgeOp, KisBrushOp, KisDeformPaintOp, KisMyPaintPaintOp, KisParticlePaintOp, KisSketchPaintOp, KisSprayPaintOp, and KisTangentNormalPaintOp.
Definition at line 183 of file kis_paintop.cc.
|
friend |
Definition at line 113 of file kis_paintop.h.
|
friend |
Definition at line 145 of file kis_paintop.h.
|
private |
Definition at line 149 of file kis_paintop.h.
| KisFixedPaintDeviceSP KisPaintOp::dab |
Definition at line 45 of file kis_paintop.cc.
| bool KisPaintOp::fanCornersEnabled {false} |
Definition at line 48 of file kis_paintop.cc.
| qreal KisPaintOp::fanCornersStep {1.0} |
Definition at line 49 of file kis_paintop.cc.
| KisPainter * KisPaintOp::painter {nullptr} |
Definition at line 46 of file kis_paintop.cc.
| KisPaintOp* KisPaintOp::q {nullptr} |
Definition at line 43 of file kis_paintop.cc.