|
Krita Source Code Documentation
|
#include <kis_painter.h>
Inheritance diagram for KisPainter:Public Types | |
| enum | FillStyle { FillStyleNone , FillStyleForegroundColor , FillStyleBackgroundColor , FillStylePattern , FillStyleGenerator } |
| This enum contains the styles with which we can fill things like polygons and ellipses. More... | |
| enum | StrokeStyle { StrokeStyleNone , StrokeStyleBrush } |
| The style of the brush stroke around polygons and so. More... | |
Public Member Functions | |
| void | addDirtyRect (const QRect &r) |
| void | addDirtyRects (const QVector< QRect > &rects) |
| bool | antiAliasPolygonFill () |
| Return whether a polygon's filled area should be anti-aliased or not. | |
| void | applyDevice (const QRect &applyRect, const KisRenderedDab &dab, KisRandomAccessorSP dstIt, const KoColorSpace *srcColorSpace, KoCompositeOp::ParameterInfo &localParamInfo) |
| void | applyDeviceWithSelection (const QRect &applyRect, const KisRenderedDab &dab, KisRandomAccessorSP dstIt, KisRandomConstAccessorSP maskIt, const KoColorSpace *srcColorSpace, KoCompositeOp::ParameterInfo &localParamInfo) |
| const KoColor & | backgroundColor () const |
| Returns the current background color. | |
| void | begin (KisPaintDeviceSP device) |
| void | begin (KisPaintDeviceSP device, KisSelectionSP selection) |
| void | beginTransaction (const KUndo2MagicString &transactionName=KUndo2MagicString(), int timedID=-1) |
| Begin an undoable paint operation. | |
| void | bitBlt (const QPoint &pos, const KisPaintDeviceSP srcDev, const QRect &srcRect) |
| void | bitBlt (qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight) |
| void | bitBltOldData (const QPoint &pos, const KisPaintDeviceSP srcDev, const QRect &srcRect) |
| void | bitBltOldData (qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight) |
| void | bitBltWithFixedSelection (qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, const KisFixedPaintDeviceSP selection, qint32 selX, qint32 selY, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight) |
| void | bitBltWithFixedSelection (qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, const KisFixedPaintDeviceSP selection, qint32 srcWidth, qint32 srcHeight) |
| void | bltFixed (const QPoint &pos, const KisFixedPaintDeviceSP srcDev, const QRect &srcRect) |
| void | bltFixed (const QRect &rc, const QList< KisRenderedDab > allSrcDevices) |
| void | bltFixed (qint32 dstX, qint32 dstY, const KisFixedPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight) |
| void | bltFixedWithFixedSelection (qint32 dstX, qint32 dstY, const KisFixedPaintDeviceSP srcDev, const KisFixedPaintDeviceSP selection, qint32 selX, qint32 selY, qint32 srcX, qint32 srcY, quint32 srcWidth, quint32 srcHeight) |
| void | bltFixedWithFixedSelection (qint32 dstX, qint32 dstY, const KisFixedPaintDeviceSP srcDev, const KisFixedPaintDeviceSP selection, quint32 srcWidth, quint32 srcHeight) |
| const QVector< QPair< QPointF, QPointF > > | calculateAllMirroredPoints (const QPair< QPointF, QPointF > &pair) |
| const QVector< QPointF > | calculateAllMirroredPoints (const QPointF &pos) |
| const QVector< QRect > | calculateAllMirroredRects (const QRect &rc) |
| template<class T > | |
| QVector< T > | calculateMirroredObjects (const T &object) |
| QBitArray | channelFlags () |
| const KoCompositeOp * | compositeOp (const KoColorSpace *srcCS) |
| QString | compositeOpId () |
| Returns the current composite op Id. | |
| void | copyMirrorInformationFrom (const KisPainter *other) |
| void | deleteTransaction () |
| KisPaintDeviceSP | device () |
| const KisPaintDeviceSP | device () const |
| Returns the current paint device. | |
| void | drawDDALine (const QPointF &start, const QPointF &end) |
| void | drawLine (const QPointF &start, const QPointF &end) |
| void | drawLine (const QPointF &start, const QPointF &end, qreal width, bool antialias) |
| void | drawPainterPath (const QPainterPath &path, const QPen &pen) |
| void | drawPainterPath (const QPainterPath &path, const QPen &pen, const QRect &requestedRect) |
| void | drawThickLine (const QPointF &start, const QPointF &end, int startWidth, int endWidth) |
| void | drawWobblyLine (const QPointF &start, const QPointF &end) |
| void | drawWuLine (const QPointF &start, const QPointF &end) |
| void | end () |
| KUndo2Command * | endAndTakeTransaction () |
| void | endTransaction (KisPostExecutionUndoAdapter *undoAdapter) |
| void | endTransaction (KisUndoAdapter *undoAdapter) |
| Finish the undoable paint operation. | |
| void | fill (qint32 x, qint32 y, qint32 width, qint32 height, const KoColor &color) |
| void | fillPainterPath (const QPainterPath &path) |
| void | fillPainterPath (const QPainterPath &path, const QRect &requestedRect) |
| void | fillPainterPathImpl (const QPainterPath &path, const QRect &requestedRect) |
| FillStyle | fillStyle () const |
| Returns the current fill style. | |
| qreal | flow () const |
| const KisFilterConfigurationSP | generator () const |
| void | getBezierCurvePoints (const QPointF &pos1, const QPointF &control1, const QPointF &control2, const QPointF &pos2, vQPointF &points) const |
| const KoAbstractGradientSP | gradient () const |
| bool | hasDirtyRegion () const |
| bool | hasHorizontalMirroring () const |
| bool | hasMirroring () const |
| bool | hasVerticalMirroring () const |
| bool | isOpacityUnit () const |
| KisPainter () | |
| Construct painter without a device. | |
| KisPainter (KisPaintDeviceSP device) | |
| Construct a painter, and begin painting on the device. | |
| KisPainter (KisPaintDeviceSP device, KisSelectionSP selection) | |
| Construct a painter, and begin painting on the device. All actions will be masked by the given selection. | |
| void | mirrorDab (Qt::Orientation direction, KisRenderedDab *dab, bool skipMirrorPixels=false) const |
| void | mirrorRect (Qt::Orientation direction, QRect *rc) const |
| qreal | opacityF () const |
| Returns the opacity that is used in painting. | |
| void | paintAt (const KisPaintInformation &pos, KisDistanceInformation *savedDist) |
| void | paintBezierCurve (const KisPaintInformation &pi1, const QPointF &control1, const QPointF &control2, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) |
| const KoColor & | paintColor () const |
| Returns the color that will be used to paint with. | |
| void | paintEllipse (const qreal x, const qreal y, const qreal w, const qreal h) |
| void | paintEllipse (const QRectF &rect) |
| void | paintLine (const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) |
| KisPaintOp * | paintOp () const |
| void | paintPainterPath (const QPainterPath &path) |
| void | paintPolygon (const vQPointF &points) |
| void | paintPolyline (const QVector< QPointF > &points, int index=0, int numPoints=-1) |
| void | paintRect (const qreal x, const qreal y, const qreal w, const qreal h) |
| void | paintRect (const QRectF &rect) |
| const KoPatternSP | pattern () const |
| Returns the currently set pattern. | |
| QTransform | patternTransform () |
| get the current transform on the pattern. | |
| KisPaintOpPresetSP | preset () const |
| Return the paintop preset. | |
| Private (KisPainter *_q) | |
| Private (KisPainter *_q, const KoColorSpace *cs) | |
| void | putTransaction (KisTransaction *transaction) |
| continue a transaction started somewhere else | |
| void | renderDabWithMirroringNonIncremental (QRect rc, KisPaintDeviceSP dab) |
| void | renderMirrorMask (QRect rc, KisFixedPaintDeviceSP dab) |
| void | renderMirrorMask (QRect rc, KisFixedPaintDeviceSP dab, KisFixedPaintDeviceSP mask) |
| void | renderMirrorMask (QRect rc, KisPaintDeviceSP dab) |
| void | renderMirrorMask (QRect rc, KisPaintDeviceSP dab, int sx, int sy, KisFixedPaintDeviceSP mask) |
| void | renderMirrorMaskSafe (QRect rc, KisFixedPaintDeviceSP dab, bool preserveDab) |
| void | renderMirrorMaskSafe (QRect rc, KisFixedPaintDeviceSP dab, KisFixedPaintDeviceSP mask, bool preserveDab) |
| void | renderMirrorMaskSafe (QRect rc, KisPaintDeviceSP dab, int sx, int sy, KisFixedPaintDeviceSP mask, bool preserveMask) |
| void | revertTransaction () |
| Cancel all the changes made by the painter. | |
| KisRunnableStrokeJobsInterface * | runnableStrokeJobsInterface () const |
| KisSelectionSP | selection () |
| void | setAntiAliasPolygonFill (bool antiAliasPolygonFill) |
| Set whether a polygon's filled area should be anti-aliased or not. The default is true. | |
| void | setAverageOpacity (qreal averageOpacity) |
| void | setBackgroundColor (const KoColor &color) |
| void | setChannelFlags (QBitArray channelFlags) |
| void | setColorConversionFlags (KoColorConversionTransformation::ConversionFlags conversionFlags) |
| void | setCompositeOpId (const KoCompositeOp *op) |
| void | setCompositeOpId (const QString &op) |
| Set the composite op for this painter by string. | |
| void | setFillStyle (FillStyle fillStyle) |
| Set the current style with which to fill. | |
| void | setFlow (qreal flow) |
| void | setGenerator (KisFilterConfigurationSP generator) |
| Set the current generator (a generator can be used to fill an area. | |
| void | setGradient (const KoAbstractGradientSP gradient) |
| void | setMaskImageSize (qint32 width, qint32 height) |
| void | setMirrorInformation (const QPointF &axesCenter, bool mirrorHorizontally, bool mirrorVertically) |
| void | setOpacityF (qreal opacity) |
| void | setOpacityToUnit () |
| void | setOpacityU8 (quint8 opacity) |
| Set the opacity which is used in painting (like filling polygons) | |
| void | setOpacityUpdateAverage (qreal opacity) |
| void | setPaintColor (const KoColor &color) |
| void | setPaintOpPreset (KisPaintOpPresetSP preset, KisNodeSP node, KisImageSP image) |
| void | setPattern (const KoPatternSP pattern) |
| Set the current pattern. | |
| void | setPatternTransform (QTransform transform) |
| Set the transform on the pattern. | |
| void | setProgress (KoUpdater *progressUpdater) |
| void | setRenderingIntent (KoColorConversionTransformation::Intent intent) |
| void | setRunnableStrokeJobsInterface (KisRunnableStrokeJobsInterface *interface) |
| void | setSelection (KisSelectionSP selection) |
| void | setStrokeStyle (StrokeStyle strokeStyle) |
| Set the current brush stroke style. | |
| StrokeStyle | strokeStyle () const |
| Returns the current brush stroke style. | |
| QVector< QRect > | takeDirtyRegion () |
| KisTransaction * | takeTransaction () |
| take transaction out of the reach of KisPainter | |
| bool | tryReduceSourceRect (const KisPaintDevice *srcDev, QRect *srcRect, qint32 *srcX, qint32 *srcY, qint32 *srcWidth, qint32 *srcHeight, qint32 *dstX, qint32 *dstY) |
| virtual | ~KisPainter () |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Static Public Member Functions | |
| static qreal | blendAverageOpacity (qreal opacity, qreal averageOpacity) |
| static bool | checkDeviceHasTransparency (KisPaintDeviceSP dev) |
| static KisPaintDeviceSP | convertToAlphaAsAlpha (KisPaintDeviceSP src) |
| static KisPaintDeviceSP | convertToAlphaAsGray (KisPaintDeviceSP src) |
| static KisPaintDeviceSP | convertToAlphaAsPureAlpha (KisPaintDeviceSP src) |
| static void | copyAreaOptimized (const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect) |
| static void | copyAreaOptimized (const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect, KisSelectionSP selection) |
| static void | copyAreaOptimizedOldData (const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect) |
Protected Member Functions | |
| void | fillPolygon (const vQPointF &points, FillStyle fillStyle) |
| Fill the polygon defined by points with the fillStyle. | |
| void | init () |
| Initialize, set everything to '0' or defaults. | |
| KoUpdater * | progressUpdater () |
Private Member Functions | |
| template<bool useOldSrcData> | |
| void | bitBltImpl (qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight) |
| void | compositeOnePixel (quint8 *dst, const KoColor &color) |
| float | frac (float value) |
| float | invertFrac (float value) |
| KisPainter (const KisPainter &) | |
| KisPainter & | operator= (const KisPainter &) |
Private Attributes | |
| Private *const | d |
KisPainter contains the graphics primitives necessary to draw on a KisPaintDevice. This is the same kind of abstraction as used in Qt itself, where you have QPainter and QPaintDevice.
However, KisPainter works on a tiled image and supports different color models, and that's a lot more complicated.
KisPainter supports transactions that can group various paint operations in one undoable step.
For more complex operations, you might want to have a look at the subclasses of KisPainter: KisConvolutionPainter, KisFillPainter and KisGradientPainter
KisPainter sets a number of default values, like COMPOSITE_OVER for compositeop, OPACITY_OPAQUE for opacity and no selection for selection.
Definition at line 65 of file kis_painter.h.
This enum contains the styles with which we can fill things like polygons and ellipses.
| Enumerator | |
|---|---|
| FillStyleNone | |
| FillStyleForegroundColor | |
| FillStyleBackgroundColor | |
| FillStylePattern | |
| FillStyleGenerator | |
Definition at line 718 of file kis_painter.h.
The style of the brush stroke around polygons and so.
| Enumerator | |
|---|---|
| StrokeStyleNone | |
| StrokeStyleBrush | |
Definition at line 745 of file kis_painter.h.
| KisPainter::KisPainter | ( | ) |
Construct painter without a device.
Definition at line 61 of file kis_painter.cc.
References init().
| KisPainter::KisPainter | ( | KisPaintDeviceSP | device | ) |
Construct a painter, and begin painting on the device.
Definition at line 67 of file kis_painter.cc.
| KisPainter::KisPainter | ( | KisPaintDeviceSP | device, |
| KisSelectionSP | selection ) |
Construct a painter, and begin painting on the device. All actions will be masked by the given selection.
Definition at line 75 of file kis_painter.cc.
|
virtual |
Definition at line 92 of file kis_painter.cc.
|
private |
| void KisPainter::addDirtyRect | ( | const QRect & | r | ) |
Add r to the current set of dirty rects
Definition at line 409 of file kis_painter.cc.
References d.
Add rects to the current set of dirty rects
Definition at line 417 of file kis_painter.cc.
References d.
| bool KisPainter::antiAliasPolygonFill | ( | ) |
Return whether a polygon's filled area should be anti-aliased or not.
| void KisPainter::applyDevice | ( | const QRect & | applyRect, |
| const KisRenderedDab & | dab, | ||
| KisRandomAccessorSP | dstIt, | ||
| const KoColorSpace * | srcColorSpace, | ||
| KoCompositeOp::ParameterInfo & | localParamInfo ) |
| void KisPainter::applyDeviceWithSelection | ( | const QRect & | applyRect, |
| const KisRenderedDab & | dab, | ||
| KisRandomAccessorSP | dstIt, | ||
| KisRandomConstAccessorSP | maskIt, | ||
| const KoColorSpace * | srcColorSpace, | ||
| KoCompositeOp::ParameterInfo & | localParamInfo ) |
| const KoColor & KisPainter::backgroundColor | ( | ) | const |
Returns the current background color.
| void KisPainter::begin | ( | KisPaintDeviceSP | device | ) |
| void KisPainter::begin | ( | KisPaintDeviceSP | device, |
| KisSelectionSP | selection ) |
Start painting on the specified paint device. All actions will be masked by the given selection.
Definition at line 296 of file kis_painter.cc.
References KisPaintDevice::colorSpace(), COMPOSITE_OVER, d, device, end(), KisPaintDevice::pixelSize(), and selection.
| void KisPainter::beginTransaction | ( | const KUndo2MagicString & | transactionName = KUndo2MagicString(), |
| int | timedID = -1 ) |
Begin an undoable paint operation.
Definition at line 318 of file kis_painter.cc.
References d.
| void KisPainter::bitBlt | ( | const QPoint & | pos, |
| const KisPaintDeviceSP | srcDev, | ||
| const QRect & | srcRect ) |
Convenience method that uses QPoint and QRect.
| pos | the destination coordinate, it replaces dstX and dstY. |
| srcDev | the source device. |
| srcRect | the rectangle describing the area to blast from srcDev into the current paint device. srcRect replaces srcX, srcY, srcWidth and srcHeight. |
Definition at line 831 of file kis_painter.cc.
References bitBlt().
| void KisPainter::bitBlt | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisPaintDeviceSP | srcDev, | ||
| qint32 | srcX, | ||
| qint32 | srcY, | ||
| qint32 | srcWidth, | ||
| qint32 | srcHeight ) |
Blast a region of srcWidth
| srcWidth | and srcHeight |
| srcHeight | from |
| srcDev | onto the current paint device. |
| srcX | and |
| srcY | set the x and y positions of the origin top-left corner, |
| dstX | and |
| dstY | those of the destination. Any pixel read outside the limits of |
| srcDev | will return the default pixel, this is a property of KisPaintDevice. |
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| srcX | the source x-coordinate |
| srcY | the source y-coordinate |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 822 of file kis_painter.cc.
|
private |
An optimization, which crops the source rect by the bounds of the source device when it is possible
Definition at line 658 of file kis_painter.cc.
References addDirtyRect(), KisPaintDevice::colorSpace(), COMPOSITE_COPY, compositeOp(), KisPaintDevice::createRandomConstAccessorNG(), d, KisSharedPtr< T >::data(), KisPaintDevice::defaultBounds(), KisDefaultBoundsBase::imageBorderRect(), KisSharedPtr< T >::isNull(), KisRandomConstAccessorNG::moveTo(), KisRandomConstAccessorNG::numContiguousColumns(), KisRandomConstAccessorNG::numContiguousRows(), KisBaseConstAccessor::oldRawData(), KisBaseAccessor::rawData(), KisRandomConstAccessorNG::rowStride(), and KisDefaultBoundsBase::wrapAroundMode().
| void KisPainter::bitBltOldData | ( | const QPoint & | pos, |
| const KisPaintDeviceSP | srcDev, | ||
| const QRect & | srcRect ) |
Convenience method that uses QPoint and QRect.
| pos | the destination coordinate, it replaces dstX and dstY. |
| srcDev | the source device. |
| srcRect | the rectangle describing the area to blast from |
| srcDev | into the current paint device. srcRect replaces srcX, srcY, srcWidth and srcHeight. |
Definition at line 845 of file kis_painter.cc.
References bitBltOldData().
| void KisPainter::bitBltOldData | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisPaintDeviceSP | srcDev, | ||
| qint32 | srcX, | ||
| qint32 | srcY, | ||
| qint32 | srcWidth, | ||
| qint32 | srcHeight ) |
The same as bitBlt() but reads data from oldData() part of the device
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| srcX | the source x-coordinate |
| srcY | the source y-coordinate |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 836 of file kis_painter.cc.
| void KisPainter::bitBltWithFixedSelection | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisPaintDeviceSP | srcDev, | ||
| const KisFixedPaintDeviceSP | selection, | ||
| qint32 | selX, | ||
| qint32 | selY, | ||
| qint32 | srcX, | ||
| qint32 | srcY, | ||
| qint32 | srcWidth, | ||
| qint32 | srcHeight ) |
Blasts a
| selection | of srcWidth |
| srcWidth | and srcHeight |
| srcHeight | of |
| srcDev | on the current paint device. There is parameters to control where the area begins in each distinct device, explained below. |
| selection | can be used as a mask to shape |
| srcDev | to something interesting in the same step it is rendered to the current paint device. |
| selection | 's colorspace must be alpha8 (the colorspace for selections/transparency), the rectangle formed by |
| selX |
param selY ,
| srcWidth | and |
| srcHeight | must not go beyond its limits, and they must be different from zero. |
| selection | and KisPainter's selection (the user selection) are fused together through the composite operation COMPOSITE_MULT. Any pixel read outside the limits of |
| srcDev | will return the default pixel, this is a property of KisPaintDevice. |
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| selection | the custom selection to apply on the source device |
| selX | the selection x-coordinate |
| selY | the selection y-coordinate |
| srcX | the source x-coordinate |
| srcY | the source y-coordinate |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
An optimization, which crops the source rect by the bounds of the source device when it is possible
Definition at line 510 of file kis_painter.cc.
References addDirtyRect(), KoColorSpaceRegistry::alpha8(), KisPaintDevice::colorSpace(), KoCompositeOp::ParameterInfo::cols, KoCompositeOp::composite(), COMPOSITE_MULT, compositeOp(), KoColorSpace::compositeOp(), d, KoCompositeOp::ParameterInfo::dstRowStart, KoCompositeOp::ParameterInfo::dstRowStride, KoCompositeOp::ParameterInfo::flow, KoColorSpaceRegistry::instance(), KisSharedPtr< T >::isNull(), KIS_SAFE_ASSERT_RECOVER_RETURN, KoCompositeOp::ParameterInfo::maskRowStart, KoCompositeOp::ParameterInfo::maskRowStride, KoCompositeOp::ParameterInfo::opacity, KisPaintDevice::pixelSize(), KisPaintDevice::readBytes(), KoCompositeOp::ParameterInfo::rows, selection, KoCompositeOp::ParameterInfo::srcRowStart, KoCompositeOp::ParameterInfo::srcRowStride, and warnKrita.
| void KisPainter::bitBltWithFixedSelection | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisPaintDeviceSP | srcDev, | ||
| const KisFixedPaintDeviceSP | selection, | ||
| qint32 | srcWidth, | ||
| qint32 | srcHeight ) |
Convenience method that assumes selX, selY, srcX and srcY are equal to 0. Best used when selection and the desired area of srcDev have exactly the same dimensions and are specially made for each other.
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| selection | the custom selection to apply on the source device |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 649 of file kis_painter.cc.
References bitBltWithFixedSelection(), and selection.
|
static |
Calculate average opacity value after painting a single dab with opacity
Definition at line 2698 of file kis_painter.cc.
| void KisPainter::bltFixed | ( | const QPoint & | pos, |
| const KisFixedPaintDeviceSP | srcDev, | ||
| const QRect & | srcRect ) |
Convenience method that uses QPoint and QRect.
| pos | the destination coordinate, it replaces dstX and dstY. |
| srcDev | the source device. |
| srcRect | the rectangle describing the area to blast from srcDev into the current paint device. |
| srcRect | replaces srcX, srcY, srcWidth and srcHeight. |
Definition at line 1022 of file kis_painter.cc.
References bltFixed().
| void KisPainter::bltFixed | ( | const QRect & | rc, |
| const QList< KisRenderedDab > | allSrcDevices ) |
Render the area rc from srcDevices on the destination device. If rc doesn't cross the device's rect, then the device is not rendered at all.
Definition at line 138 of file kis_painter_blt_multi_fixed.cpp.
References bltFixed(), KisFixedPaintDevice::bounds(), KisFixedPaintDevice::colorSpace(), d, KisRenderedDab::device, KIS_SAFE_ASSERT_RECOVER_RETURN, and KisRenderedDab::realBounds().
| void KisPainter::bltFixed | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisFixedPaintDeviceSP | srcDev, | ||
| qint32 | srcX, | ||
| qint32 | srcY, | ||
| qint32 | srcWidth, | ||
| qint32 | srcHeight ) |
Blast a region of srcWidth srcWidth and srcHeight srcHeight from srcDev onto the current paint device. srcX and srcY set the x and y positions of the origin top-left corner, dstX and dstY those of the destination. srcDev is a KisFixedPaintDevice : this means that srcDev must have the same colorspace as the destination device.
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| srcX | the source x-coordinate |
| srcY | the source y-coordinate |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 950 of file kis_painter.cc.
References addDirtyRect(), KisFixedPaintDevice::bounds(), KisFixedPaintDevice::colorSpace(), compositeOp(), d, KisFixedPaintDevice::data(), KisSharedPtr< T >::isNull(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisFixedPaintDevice::pixelSize(), KisPaintDevice::pixelSize(), KisPaintDevice::readBytes(), and warnKrita.
| void KisPainter::bltFixedWithFixedSelection | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisFixedPaintDeviceSP | srcDev, | ||
| const KisFixedPaintDeviceSP | selection, | ||
| qint32 | selX, | ||
| qint32 | selY, | ||
| qint32 | srcX, | ||
| qint32 | srcY, | ||
| quint32 | srcWidth, | ||
| quint32 | srcHeight ) |
Blasts a selection of srcWidth srcWidth and srcHeight srcHeight of srcDev on the current paint device. There is parameters to control the top-left corner of the area in each respective paint device (dstX, dstY, srcX, srcY). selection can be used as a mask to shape srcDev to something interesting in the same step it is rendered to the current paint device. srcDev is a KisFixedPaintDevice : this means that srcDev must have the same colorspace as the destination device. selection 's colorspace must be alpha8 (the colorspace for selections/transparency). The rectangle formed by the respective top-left coordinates of each device and srcWidth and srcHeight must not go beyond their limits, and they must be different from zero. selection and KisPainter's selection (the user selection) are fused together through the composite operation COMPOSITE_MULT.
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| selection | the selection stored in fixed device |
| selX | the selection x-coordinate |
| selY | the selection y-coordinate |
| srcX | the source x-coordinate |
| srcY | the source y-coordinate |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 1027 of file kis_painter.cc.
References addDirtyRect(), KoColorSpaceRegistry::alpha8(), KisFixedPaintDevice::bounds(), KisFixedPaintDevice::colorSpace(), KoCompositeOp::ParameterInfo::cols, KoCompositeOp::composite(), COMPOSITE_MULT, compositeOp(), KoColorSpace::compositeOp(), d, KisFixedPaintDevice::data(), KoCompositeOp::ParameterInfo::dstRowStart, KoCompositeOp::ParameterInfo::dstRowStride, KoCompositeOp::ParameterInfo::flow, KoColorSpaceRegistry::instance(), KisSharedPtr< T >::isNull(), KIS_ASSERT, KoCompositeOp::ParameterInfo::maskRowStart, KoCompositeOp::ParameterInfo::maskRowStride, KoCompositeOp::ParameterInfo::opacity, KisFixedPaintDevice::pixelSize(), KoCompositeOp::ParameterInfo::rows, selection, KoCompositeOp::ParameterInfo::srcRowStart, KoCompositeOp::ParameterInfo::srcRowStride, and warnKrita.
| void KisPainter::bltFixedWithFixedSelection | ( | qint32 | dstX, |
| qint32 | dstY, | ||
| const KisFixedPaintDeviceSP | srcDev, | ||
| const KisFixedPaintDeviceSP | selection, | ||
| quint32 | srcWidth, | ||
| quint32 | srcHeight ) |
Convenience method that assumes selX, selY, srcX and srcY are equal to 0. Best used when selection and srcDev have exactly the same dimensions and are specially made for each other.
| dstX | the destination x-coordinate |
| dstY | the destination y-coordinate |
| srcDev | the source device |
| selection | the custom selection to apply on the source device |
| srcWidth | the width of the region to be manipulated |
| srcHeight | the height of the region to be manipulated |
Definition at line 1139 of file kis_painter.cc.
References bltFixedWithFixedSelection(), KisFixedPaintDevice::bounds(), selection, KisSelection::x(), and KisSelection::y().
| const QVector< QPair< QPointF, QPointF > > KisPainter::calculateAllMirroredPoints | ( | const QPair< QPointF, QPointF > & | pair | ) |
Calculate the list of the mirrored point pairs according to the current mirroring configuration.
Definition at line 3150 of file kis_painter.cc.
References d.
| const QVector< QPointF > KisPainter::calculateAllMirroredPoints | ( | const QPointF & | pos | ) |
Calculate the list of the mirrored points according to the current mirroring configuration.
Definition at line 3145 of file kis_painter.cc.
References d.
| const QVector< QRect > KisPainter::calculateAllMirroredRects | ( | const QRect & | rc | ) |
Calculate the list of the mirrored rects that will be painted on the the canvas when calling renderMirrorMask() at al
Definition at line 3140 of file kis_painter.cc.
References d.
| QVector< T > KisPainter::calculateMirroredObjects | ( | const T & | object | ) |
| QBitArray KisPainter::channelFlags | ( | ) |
|
static |
Definition at line 268 of file kis_painter.cc.
References KisDefaultBoundsBase::bounds(), KisPaintDevice::colorSpace(), KisPaintDevice::defaultBounds(), KisPaintDevice::exactBounds(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), OPACITY_OPAQUE_U8, KoColorSpace::opacityU8(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
Definition at line 1636 of file kis_painter.cc.
References KoColor::colorSpace(), d, and KoColor::data().
| const KoCompositeOp * KisPainter::compositeOp | ( | const KoColorSpace * | srcCS | ) |
| QString KisPainter::compositeOpId | ( | ) |
Returns the current composite op Id.
|
static |
Definition at line 202 of file kis_painter.cc.
References KoColorSpaceRegistry::instance(), KoColorSpace::intensity8(), KoColorSpaceMaths< _T, _Tdst >::multiply(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KoColorSpace::opacityU8(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
|
static |
Definition at line 226 of file kis_painter.cc.
References KoColorSpaceRegistry::instance(), KoColorSpace::intensity8(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
|
static |
creates a paint device with only alpha values from src
Definition at line 247 of file kis_painter.cc.
References KoColorSpaceRegistry::instance(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KoColorSpace::opacityU8(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
|
static |
Definition at line 153 of file kis_painter.cc.
|
static |
Definition at line 169 of file kis_painter.cc.
References bitBlt(), COMPOSITE_COPY, copyAreaOptimized(), KisPaintDevice::extent(), KisSelection::selectedRect(), selection, setCompositeOpId(), and setSelection().
|
static |
Definition at line 161 of file kis_painter.cc.
| void KisPainter::copyMirrorInformationFrom | ( | const KisPainter * | other | ) |
| void KisPainter::deleteTransaction | ( | ) |
Finish the transaction and delete it's undo information. NOTE: Be careful, because all the previous transactions will become non-undoable after execution of this method.
Definition at line 372 of file kis_painter.cc.
References d.
| KisPaintDeviceSP KisPainter::device | ( | ) |
| const KisPaintDeviceSP KisPainter::device | ( | ) | const |
Returns the current paint device.
| void KisPainter::drawDDALine | ( | const QPointF & | start, |
| const QPointF & | end ) |
paints an unstroked, aliased one-pixel line using the DDA algorithm from specified start position to the specified end position.
Definition at line 1740 of file kis_painter.cc.
References compositeOnePixel(), d, KisRandomConstAccessorNG::moveTo(), KisBaseConstAccessor::oldRawData(), KisBaseAccessor::rawData(), and SELECTION_THRESHOLD.
| void KisPainter::drawLine | ( | const QPointF & | start, |
| const QPointF & | end ) |
paint an unstroked one-pixel wide line from specified start position to the specified end position.
Definition at line 1735 of file kis_painter.cc.
References drawThickLine().
| void KisPainter::drawLine | ( | const QPointF & | start, |
| const QPointF & | end, | ||
| qreal | width, | ||
| bool | antialias ) |
paint an unstroked line with thickness from specified start position to the specified end position. Scanline algorithm is used.
Definition at line 1653 of file kis_painter.cc.
References KoColor::colorSpace(), compositeOnePixel(), d, KoColor::data(), KisRandomConstAccessorNG::moveTo(), KoColorSpace::multiplyAlpha(), KisBaseConstAccessor::oldRawData(), KisBaseAccessor::rawData(), and SELECTION_THRESHOLD.
| void KisPainter::drawPainterPath | ( | const QPainterPath & | path, |
| const QPen & | pen ) |
Definition at line 1558 of file kis_painter.cc.
References drawPainterPath().
| void KisPainter::drawPainterPath | ( | const QPainterPath & | path, |
| const QPen & | pen, | ||
| const QRect & | requestedRect ) |
Draw the path using the Pen
if requestedRect is null, the entire path is painted
Definition at line 1563 of file kis_painter.cc.
References antiAliasPolygonFill, bitBlt(), d, OPACITY_OPAQUE_U8, and paintColor.
| void KisPainter::drawThickLine | ( | const QPointF & | start, |
| const QPointF & | end, | ||
| int | startWidth, | ||
| int | endWidth ) |
Paint an unstroked wide line from the specified start to the specified end position with width varying from start at the start to end at the end.
XXX: the width should be set in doubles, not integers.
Definition at line 2168 of file kis_painter.cc.
References compositeOnePixel(), d, KisRandomConstAccessorNG::moveTo(), KisBaseConstAccessor::oldRawData(), KoColor::opacityF(), KoColorSpace::opacityF(), KisBaseAccessor::rawData(), SELECTION_THRESHOLD, and KoColor::setOpacity().
| void KisPainter::drawWobblyLine | ( | const QPointF & | start, |
| const QPointF & | end ) |
Paint an unstroked, wobbly one-pixel wide line from the specified start to the specified end position.
Definition at line 1813 of file kis_painter.cc.
References compositeOnePixel(), d, KisRandomConstAccessorNG::moveTo(), KisBaseConstAccessor::oldRawData(), KisBaseAccessor::rawData(), SELECTION_THRESHOLD, and KoColor::setOpacity().
| void KisPainter::drawWuLine | ( | const QPointF & | start, |
| const QPointF & | end ) |
Paint an unstroked, anti-aliased one-pixel wide line from the specified start to the specified end position using the Wu algorithm
Definition at line 1898 of file kis_painter.cc.
References compositeOnePixel(), d, frac(), invertFrac(), KisRandomConstAccessorNG::moveTo(), KisBaseConstAccessor::oldRawData(), OPACITY_OPAQUE_U8, KisBaseAccessor::rawData(), SELECTION_THRESHOLD, and KoColor::setOpacity().
| void KisPainter::end | ( | ) |
Finish painting on the current device
Definition at line 311 of file kis_painter.cc.
References d.
| KUndo2Command * KisPainter::endAndTakeTransaction | ( | ) |
Finishes a transaction and returns a pointer to its undo command
Definition at line 360 of file kis_painter.cc.
References d.
| void KisPainter::endTransaction | ( | KisPostExecutionUndoAdapter * | undoAdapter | ) |
Finish transaction and load it to a special adapter for strokes
Definition at line 350 of file kis_painter.cc.
References d.
| void KisPainter::endTransaction | ( | KisUndoAdapter * | undoAdapter | ) |
Finish the undoable paint operation.
Definition at line 340 of file kis_painter.cc.
References d.
fills a region of width width and height height of the current paint device with the color color. x and y set the x and y positions of the origin top-left corner.
| x | the destination x-coordinate |
| y | the destination y-coordinate |
| width | the width of the region to be manipulated |
| height | the height of the region to be manipulated |
| color | the color the area is filled with |
Definition at line 851 of file kis_painter.cc.
References addDirtyRect(), KoColor::colorSpace(), compositeOp(), KisPaintDevice::createRandomConstAccessorNG(), d, KoColor::data(), KisRandomConstAccessorNG::moveTo(), KisRandomConstAccessorNG::numContiguousColumns(), KisRandomConstAccessorNG::numContiguousRows(), KisBaseConstAccessor::oldRawData(), KisBaseAccessor::rawData(), and KisRandomConstAccessorNG::rowStride().
| void KisPainter::fillPainterPath | ( | const QPainterPath & | path | ) |
Fills the area enclosed by the given QPainterPath Convenience method for fillPainterPath(path, rect)
Definition at line 1427 of file kis_painter.cc.
References fillPainterPath().
| void KisPainter::fillPainterPath | ( | const QPainterPath & | path, |
| const QRect & | requestedRect ) |
Fills the portion of an area enclosed by the given QPainterPath
| path | the portion of the path to fill |
| requestedRect | the rectangle containing the area |
Definition at line 1432 of file kis_painter.cc.
References d, and KisLodTransform::map().
| void KisPainter::fillPainterPathImpl | ( | const QPainterPath & | path, |
| const QRect & | requestedRect ) |
Fill the polygon defined by points with the fillStyle.
Definition at line 1327 of file kis_painter.cc.
References d, fillPainterPath(), fillStyle, and FillStyleNone.
| FillStyle KisPainter::fillStyle | ( | ) | const |
Returns the current fill style.
| qreal KisPainter::flow | ( | ) | const |
Definition at line 2682 of file kis_painter.cc.
References d.
|
inlineprivate |
| const KisFilterConfigurationSP KisPainter::generator | ( | ) | const |
| void KisPainter::getBezierCurvePoints | ( | const QPointF & | pos1, |
| const QPointF & | control1, | ||
| const QPointF & | control2, | ||
| const QPointF & | pos2, | ||
| vQPointF & | points ) const |
Fill the given vector points with the points needed to draw the Bezier curve between pos1 and pos2 using control points control1 and control2, excluding the final pos2.
Definition at line 1226 of file kis_painter.cc.
References getBezierCurvePoints(), and toKisVector2D().
| const KoAbstractGradientSP KisPainter::gradient | ( | ) | const |
| bool KisPainter::hasDirtyRegion | ( | ) | const |
Definition at line 3075 of file kis_painter.cc.
References d.
| bool KisPainter::hasHorizontalMirroring | ( | ) | const |
Indicates if horizontal mirroring mode is activated
Definition at line 2821 of file kis_painter.cc.
References d.
| bool KisPainter::hasMirroring | ( | ) | const |
Returns whether the mirroring methods will do any work when called
Definition at line 2816 of file kis_painter.cc.
References d.
| bool KisPainter::hasVerticalMirroring | ( | ) | const |
Indicates if vertical mirroring mode is activated
Definition at line 2826 of file kis_painter.cc.
References d.
|
protected |
Initialize, set everything to '0' or defaults.
Definition at line 84 of file kis_painter.cc.
References d, KoColorConversionTransformation::internalConversionFlags(), and KoColorConversionTransformation::internalRenderingIntent().
|
inlineprivate |
| bool KisPainter::isOpacityUnit | ( | ) | const |
| void KisPainter::mirrorDab | ( | Qt::Orientation | direction, |
| KisRenderedDab * | dab, | ||
| bool | skipMirrorPixels = false ) const |
Mirror dab in the requested direction around the center point defined in the painter. The dab's offset is adjusted automatically.
Definition at line 3088 of file kis_painter.cc.
References d, KisLodTransform::map(), and KritaUtils::mirrorDab().
| void KisPainter::mirrorRect | ( | Qt::Orientation | direction, |
| QRect * | rc ) const |
Mirror rc in the requested direction around the center point defined in the painter.
Definition at line 3080 of file kis_painter.cc.
References d, KisLodTransform::map(), and KritaUtils::mirrorRect().
| qreal KisPainter::opacityF | ( | ) | const |
Returns the opacity that is used in painting.
Definition at line 2719 of file kis_painter.cc.
References d.
|
private |
| void KisPainter::paintAt | ( | const KisPaintInformation & | pos, |
| KisDistanceInformation * | savedDist ) |
| void KisPainter::paintBezierCurve | ( | const KisPaintInformation & | pi1, |
| const QPointF & | control1, | ||
| const QPointF & | control2, | ||
| const KisPaintInformation & | pi2, | ||
| KisDistanceInformation * | currentDistance ) |
Draw a Bezier curve between pi1 and pi2 using control points control1 and control2. If savedDist is less than zero, the brush is painted at pos1 before being painted along the curve using the spacing setting.
pi1 and pi2 not covered because the currently set brush has a spacing greater than that distance. Definition at line 1235 of file kis_painter.cc.
References d.
| const KoColor & KisPainter::paintColor | ( | ) | const |
Returns the color that will be used to paint with.
| void KisPainter::paintEllipse | ( | const qreal | x, |
| const qreal | y, | ||
| const qreal | w, | ||
| const qreal | h ) |
Paint the ellipse that fills the given rectangle.
| x | x coordinate of the top-left corner |
| y | y coordinate of the top-left corner |
| w | the rectangle width |
| h | the rectangle height |
Definition at line 1311 of file kis_painter.cc.
References paintEllipse().
| void KisPainter::paintEllipse | ( | const QRectF & | rect | ) |
Paint the ellipse that fills the given rectangle.
| rect | the rectangle containing the ellipse to paint. |
Definition at line 1269 of file kis_painter.cc.
References getBezierCurvePoints(), p0, p1, p2, p3, and paintPolygon().
| void KisPainter::paintLine | ( | const KisPaintInformation & | pi1, |
| const KisPaintInformation & | pi2, | ||
| KisDistanceInformation * | currentDistance ) |
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.
Definition at line 1151 of file kis_painter.cc.
References d.
| KisPaintOp * KisPainter::paintOp | ( | ) | const |
Return the active paintop (which is created based on the specified preset and will be deleted as soon as the KisPainter instance dies).
| void KisPainter::paintPainterPath | ( | const QPainterPath & | path | ) |
Stroke the given QPainterPath.
Definition at line 1380 of file kis_painter.cc.
References d, fillPainterPath(), FillStyleNone, paintBezierCurve(), paintLine(), KisPaintInformation::setPerStrokeRandomSource(), KisPaintInformation::setRandomSource(), and StrokeStyleNone.
Paint the polygon with the points given in points. It automatically closes the polygon by drawing the line from the last point to the first.
Definition at line 1351 of file kis_painter.cc.
References d, KisAlgebra2D::directionBetweenPoints(), distance(), fillPolygon(), FillStyleNone, paintLine(), KisPaintInformation::setPerStrokeRandomSource(), KisPaintInformation::setRandomSource(), and StrokeStyleNone.
| void KisPainter::paintPolyline | ( | const QVector< QPointF > & | points, |
| int | index = 0, | ||
| int | numPoints = -1 ) |
Paint a line that connects the dots in points
Definition at line 1161 of file kis_painter.cc.
References d, KisAlgebra2D::directionBetweenPoints(), fillPolygon(), FillStyleNone, paintLine(), KisPaintInformation::setPerStrokeRandomSource(), KisPaintInformation::setRandomSource(), and StrokeStyleNone.
| void KisPainter::paintRect | ( | const qreal | x, |
| const qreal | y, | ||
| const qreal | w, | ||
| const qreal | h ) |
Paint a rectangle.
| x | x coordinate of the top-left corner |
| y | y coordinate of the top-left corner |
| w | the rectangle width |
| h | the rectangle height |
Definition at line 1261 of file kis_painter.cc.
References paintRect().
| void KisPainter::paintRect | ( | const QRectF & | rect | ) |
Paint a rectangle.
| rect | the rectangle to paint. |
Definition at line 1247 of file kis_painter.cc.
References paintPolygon().
| const KoPatternSP KisPainter::pattern | ( | ) | const |
Returns the currently set pattern.
| QTransform KisPainter::patternTransform | ( | ) |
get the current transform on the pattern.
| KisPaintOpPresetSP KisPainter::preset | ( | ) | const |
|
inline |
Definition at line 22 of file kis_painter_p.h.
|
inline |
Definition at line 23 of file kis_painter_p.h.
|
protected |
| void KisPainter::putTransaction | ( | KisTransaction * | transaction | ) |
continue a transaction started somewhere else
Definition at line 380 of file kis_painter.cc.
References d, and transaction.
| void KisPainter::renderDabWithMirroringNonIncremental | ( | QRect | rc, |
| KisPaintDeviceSP | dab ) |
A complex method that re-renders a dab on an rc area. The rc area and all the dedicated mirroring areas are cleared before the painting, so this method should be used by paintops which do not update the canvas incrementally, but instead regenerate some internal cache dab with the COMPOSITE_COPY op.
If there are no cross-intersections, we can use a fast path and do no cycling recompositing
Definition at line 3019 of file kis_painter.cc.
References bitBlt(), d, KisPaintDevice::extent(), KisLodTransform::map(), and renderMirrorMask().
| void KisPainter::renderMirrorMask | ( | QRect | rc, |
| KisFixedPaintDeviceSP | dab ) |
First you need to setup the painter with setMirrorInformation, then these set of methods provide way to render the devices mirrored according the axesCenter vertically or horizontally or both.
| rc | rectangle area covered by dab |
| dab | this device will be mirrored in-place, it means that it will be changed |
Definition at line 2925 of file kis_painter.cc.
References bltFixed(), d, KisLodTransform::map(), and KisFixedPaintDevice::mirror().
| void KisPainter::renderMirrorMask | ( | QRect | rc, |
| KisFixedPaintDeviceSP | dab, | ||
| KisFixedPaintDeviceSP | mask ) |
Definition at line 2956 of file kis_painter.cc.
References bltFixedWithFixedSelection(), d, KisLodTransform::map(), and KisFixedPaintDevice::mirror().
| void KisPainter::renderMirrorMask | ( | QRect | rc, |
| KisPaintDeviceSP | dab ) |
Definition at line 2994 of file kis_painter.cc.
References KisPaintDevice::colorSpace(), d, mirrorDab(), KisPaintDevice::readBytes(), and renderMirrorMask().
| void KisPainter::renderMirrorMask | ( | QRect | rc, |
| KisPaintDeviceSP | dab, | ||
| int | sx, | ||
| int | sy, | ||
| KisFixedPaintDeviceSP | mask ) |
Definition at line 3007 of file kis_painter.cc.
References KisPaintDevice::colorSpace(), d, mirrorDab(), KisPaintDevice::readBytes(), and renderMirrorMask().
| void KisPainter::renderMirrorMaskSafe | ( | QRect | rc, |
| KisFixedPaintDeviceSP | dab, | ||
| bool | preserveDab ) |
Convenience method for renderMirrorMask(), allows to choose whether we need to preserve out dab or do the transformations in-place.
| rc | rectangle area covered by dab |
| dab | the device to render |
| mask | mask to use for rendering |
| preserveDab | states whether a temporary device should be created to do the transformations |
Definition at line 2892 of file kis_painter.cc.
References d, and renderMirrorMask().
| void KisPainter::renderMirrorMaskSafe | ( | QRect | rc, |
| KisFixedPaintDeviceSP | dab, | ||
| KisFixedPaintDeviceSP | mask, | ||
| bool | preserveDab ) |
Definition at line 2903 of file kis_painter.cc.
References d, and renderMirrorMask().
| void KisPainter::renderMirrorMaskSafe | ( | QRect | rc, |
| KisPaintDeviceSP | dab, | ||
| int | sx, | ||
| int | sy, | ||
| KisFixedPaintDeviceSP | mask, | ||
| bool | preserveMask ) |
Convenience method for renderMirrorMask(), allows to choose whether we need to preserve our fixed mask or do the transformations in-place.
| rc | rectangular area covered by dab |
| dab | the device to render |
| sx | x coordinate of the top left corner of the area |
| sy | y coordinate of the top left corner of the area |
| mask | mask to use for rendering |
| preserveMask | states whether a temporary device should be created to do the transformations |
Definition at line 2914 of file kis_painter.cc.
References d, and renderMirrorMask().
| void KisPainter::revertTransaction | ( | ) |
Cancel all the changes made by the painter.
Definition at line 330 of file kis_painter.cc.
References d.
| KisRunnableStrokeJobsInterface * KisPainter::runnableStrokeJobsInterface | ( | ) | const |
Get the interface for running asynchronous jobs. It is used by paintops mostly.
| KisSelectionSP KisPainter::selection | ( | ) |
| void KisPainter::setAntiAliasPolygonFill | ( | bool | antiAliasPolygonFill | ) |
Set whether a polygon's filled area should be anti-aliased or not. The default is true.
Definition at line 2658 of file kis_painter.cc.
References antiAliasPolygonFill, and d.
| void KisPainter::setAverageOpacity | ( | qreal | averageOpacity | ) |
Sets average opacity, that is used to make ALPHA_DARKEN painting look correct
Definition at line 2693 of file kis_painter.cc.
References d.
Set the current background color, and convert it to the color space of the current paint device.
Definition at line 2615 of file kis_painter.cc.
References d.
| void KisPainter::setChannelFlags | ( | QBitArray | channelFlags | ) |
Set the channelflags: a bit array where true means that the channel corresponding in position with the bit will be read by the operation, and false means that it will not be affected.
An empty channelFlags parameter means that all channels are affected.
| channelFlags | the bit array that masks the source channels; only the channels where the corresponding bit is true it will be composited onto the destination device. |
Definition at line 2575 of file kis_painter.cc.
References channelFlags(), and d.
| void KisPainter::setColorConversionFlags | ( | KoColorConversionTransformation::ConversionFlags | conversionFlags | ) |
set the conversion flags in case pixels need to be converted before painting
Definition at line 2870 of file kis_painter.cc.
References conversionFlags, and d.
| void KisPainter::setCompositeOpId | ( | const KoCompositeOp * | op | ) |
Set the composite op ID for this painter Only kept for convenience, it will just call ::setCompositeOpId(QString) with op->Id().
Definition at line 2735 of file kis_painter.cc.
References KoCompositeOp::id, and setCompositeOpId().
| void KisPainter::setCompositeOpId | ( | const QString & | op | ) |
| void KisPainter::setFlow | ( | qreal | flow | ) |
Definition at line 2677 of file kis_painter.cc.
| void KisPainter::setGenerator | ( | KisFilterConfigurationSP | generator | ) |
Set the current generator (a generator can be used to fill an area.
Definition at line 2628 of file kis_painter.cc.
| void KisPainter::setGradient | ( | const KoAbstractGradientSP | gradient | ) |
Definition at line 2768 of file kis_painter.cc.
| void KisPainter::setMaskImageSize | ( | qint32 | width, |
| qint32 | height ) |
Set the size of the tile in fillPainterPath, useful when optimizing the use of fillPainterPath e.g. Spray paintop uses more small tiles, although selections uses bigger tiles. QImage::fill is quite expensive so with smaller images you can save instructions Default and maximum size is 256x256 image
Definition at line 2831 of file kis_painter.cc.
References d.
| void KisPainter::setMirrorInformation | ( | const QPointF & | axesCenter, |
| bool | mirrorHorizontally, | ||
| bool | mirrorVertically ) |
Definition at line 2802 of file kis_painter.cc.
References axesCenter, d, mirrorHorizontally, and mirrorVertically.
| void KisPainter::setOpacityF | ( | qreal | opacity | ) |
Definition at line 2713 of file kis_painter.cc.
References d, OPACITY_OPAQUE_F, and qFuzzyCompare().
| void KisPainter::setOpacityToUnit | ( | ) |
Definition at line 2729 of file kis_painter.cc.
References d, and OPACITY_OPAQUE_F.
| void KisPainter::setOpacityU8 | ( | quint8 | opacity | ) |
Set the opacity which is used in painting (like filling polygons)
Definition at line 2707 of file kis_painter.cc.
References d, and OPACITY_OPAQUE_U8.
| void KisPainter::setOpacityUpdateAverage | ( | qreal | opacity | ) |
Sets the opacity of the painting and recalculates the mean opacity of the stroke. This mean value is used to make ALPHA_DARKEN painting look correct
Definition at line 2687 of file kis_painter.cc.
References d, OPACITY_OPAQUE_F, and qFuzzyCompare().
Set the color that will be used to paint with, and convert it to the color space of the current paint device.
Definition at line 2602 of file kis_painter.cc.
References d.
| void KisPainter::setPaintOpPreset | ( | KisPaintOpPresetSP | preset, |
| KisNodeSP | node, | ||
| KisImageSP | image ) |
Set the paintop preset to use. If image is given, the paintop will be created using this image as parameter. Some paintops really want to know about the image they work for, e.g. the clone paintop.
Definition at line 2778 of file kis_painter.cc.
References d, KisPaintOpRegistry::instance(), KisPaintOpRegistry::paintOp(), preset(), and warnKrita.
| void KisPainter::setPattern | ( | const KoPatternSP | pattern | ) |
| void KisPainter::setPatternTransform | ( | QTransform | transform | ) |
If set, the painter action is cancelable, if the action supports that.
Definition at line 2561 of file kis_painter.cc.
References d, and progressUpdater.
| void KisPainter::setRenderingIntent | ( | KoColorConversionTransformation::Intent | intent | ) |
set the rendering intent in case pixels need to be converted before painting
Definition at line 2865 of file kis_painter.cc.
References d.
| void KisPainter::setRunnableStrokeJobsInterface | ( | KisRunnableStrokeJobsInterface * | interface | ) |
Set interface for running asynchronous jobs by paintops.
NOTE: the painter does not own the interface device. It is the responsibility of the caller to ensure that the interface object is alive during the lifetime of the painter.
Definition at line 2875 of file kis_painter.cc.
References d.
| void KisPainter::setSelection | ( | KisSelectionSP | selection | ) |
| void KisPainter::setStrokeStyle | ( | KisPainter::StrokeStyle | strokeStyle | ) |
Set the current brush stroke style.
Definition at line 2668 of file kis_painter.cc.
References d, and strokeStyle.
| StrokeStyle KisPainter::strokeStyle | ( | ) | const |
Returns the current brush stroke style.
| QVector< QRect > KisPainter::takeDirtyRegion | ( | ) |
The methods in this class do not tell the paintdevice to update, but they calculate the dirty area. This method returns this dirty area and resets it.
Definition at line 401 of file kis_painter.cc.
References d.
| KisTransaction * KisPainter::takeTransaction | ( | ) |
take transaction out of the reach of KisPainter
Definition at line 390 of file kis_painter.cc.
References d.
| bool KisPainter::tryReduceSourceRect | ( | const KisPaintDevice * | srcDev, |
| QRect * | srcRect, | ||
| qint32 * | srcX, | ||
| qint32 * | srcY, | ||
| qint32 * | srcWidth, | ||
| qint32 * | srcHeight, | ||
| qint32 * | dstX, | ||
| qint32 * | dstY ) |
| bool KisPainter::antiAliasPolygonFill {true} |
Definition at line 42 of file kis_painter_p.h.
| QPointF KisPainter::axesCenter |
Definition at line 59 of file kis_painter_p.h.
| const KoColor & KisPainter::backgroundColor |
Definition at line 36 of file kis_painter_p.h.
| const KoCompositeOp* KisPainter::cachedCompositeOp {nullptr} |
Definition at line 49 of file kis_painter_p.h.
| const KoColorSpace* KisPainter::cachedSourceColorSpace {nullptr} |
Definition at line 48 of file kis_painter_p.h.
| const KoColorSpace* KisPainter::colorSpace {nullptr} |
Definition at line 46 of file kis_painter_p.h.
| QString KisPainter::compositeOpId |
Definition at line 50 of file kis_painter_p.h.
| KoColorConversionTransformation::ConversionFlags KisPainter::conversionFlags {KoColorConversionTransformation::Empty} |
Definition at line 65 of file kis_painter_p.h.
| KoColor KisPainter::customColor |
Definition at line 37 of file kis_painter_p.h.
|
private |
Definition at line 899 of file kis_painter.h.
| KisPaintDeviceSP KisPainter::device |
Definition at line 28 of file kis_painter_p.h.
| QVector<QRect> KisPainter::dirtyRects |
Definition at line 33 of file kis_painter_p.h.
| QPointF KisPainter::duplicateOffset |
Definition at line 44 of file kis_painter_p.h.
| QScopedPointer<KisRunnableStrokeJobsInterface> KisPainter::fakeRunnableStrokeJobsInterface |
Definition at line 67 of file kis_painter_p.h.
| KisFillPainter* KisPainter::fillPainter {nullptr} |
Definition at line 55 of file kis_painter_p.h.
| KisPainter::FillStyle KisPainter::fillStyle {FillStyleNone} |
Definition at line 40 of file kis_painter_p.h.
| const KisFilterConfigurationSP KisPainter::generator |
Definition at line 38 of file kis_painter_p.h.
| const KoAbstractGradientSP KisPainter::gradient |
Definition at line 51 of file kis_painter_p.h.
| bool KisPainter::isOpacityUnit {true} |
Definition at line 62 of file kis_painter_p.h.
| qint32 KisPainter::maskImageHeight {255} |
Definition at line 58 of file kis_painter_p.h.
| qint32 KisPainter::maskImageWidth {255} |
Definition at line 57 of file kis_painter_p.h.
| QPainter* KisPainter::maskPainter {nullptr} |
Definition at line 54 of file kis_painter_p.h.
| bool KisPainter::mirrorHorizontally {false} |
Definition at line 60 of file kis_painter_p.h.
| bool KisPainter::mirrorVertically {false} |
Definition at line 61 of file kis_painter_p.h.
| const KoColor & KisPainter::paintColor |
Definition at line 35 of file kis_painter_p.h.
| KisPaintOp * KisPainter::paintOp {nullptr} |
Definition at line 34 of file kis_painter_p.h.
| KisPaintOpPresetSP KisPainter::paintOpPreset |
Definition at line 52 of file kis_painter_p.h.
| KoCompositeOp::ParameterInfo KisPainter::paramInfo |
Definition at line 63 of file kis_painter_p.h.
| const KoPatternSP KisPainter::pattern |
Definition at line 43 of file kis_painter_p.h.
| QTransform KisPainter::patternTransform |
Definition at line 68 of file kis_painter_p.h.
| quint32 KisPainter::pixelSize {0} |
Definition at line 45 of file kis_painter_p.h.
| KisPaintDeviceSP KisPainter::polygon |
Definition at line 56 of file kis_painter_p.h.
| QImage KisPainter::polygonMaskImage |
Definition at line 53 of file kis_painter_p.h.
| KoColorProfile* KisPainter::profile {nullptr} |
Definition at line 47 of file kis_painter_p.h.
| KoUpdater * KisPainter::progressUpdater {nullptr} |
Definition at line 31 of file kis_painter_p.h.
| KisPainter* KisPainter::q {nullptr} |
Definition at line 26 of file kis_painter_p.h.
| KoColorConversionTransformation::Intent KisPainter::renderingIntent {KoColorConversionTransformation::IntentPerceptual} |
Definition at line 64 of file kis_painter_p.h.
| KisRunnableStrokeJobsInterface * KisPainter::runnableStrokeJobsInterface {nullptr} |
Definition at line 66 of file kis_painter_p.h.
| KisSelectionSP KisPainter::selection |
Definition at line 29 of file kis_painter_p.h.
| KisPaintLayer* KisPainter::sourceLayer {nullptr} |
Definition at line 39 of file kis_painter_p.h.
| KisPainter::StrokeStyle KisPainter::strokeStyle {StrokeStyleBrush} |
Definition at line 41 of file kis_painter_p.h.
| KisTransaction* KisPainter::transaction {nullptr} |
Definition at line 30 of file kis_painter_p.h.