|
Krita Source Code Documentation
|
AntiAlias filter for selections inspired by FXAA. More...
#include <kis_selection_filters.h>
Inheritance diagram for KisAntiAliasSelectionFilter:Public Member Functions | |
| KUndo2MagicString | name () override |
| void | process (KisPixelSelectionSP pixelSelection, const QRect &rect) override |
Public Member Functions inherited from KisSelectionFilter | |
| virtual QRect | changeRect (const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) |
| virtual | ~KisSelectionFilter () |
Private Member Functions | |
| void | findSpanExtreme (quint8 **scanlines, qint32 x, qint32 pixelOffset, qint32 rowMultiplier, qint32 colMultiplier, qint32 direction, qint32 pixelAvg, qint32 scaledGradient, qint32 currentPixelDiff, qint32 *spanEndDistance, qint32 *pixelDiff, bool *spanExtremeValidType) const |
| Get the extreme point of the span for the current pixel in the given direction. | |
| void | findSpanExtremes (quint8 **scanlines, qint32 x, qint32 pixelOffset, qint32 rowMultiplier, qint32 colMultiplier, qint32 pixelAvg, qint32 scaledGradient, qint32 currentPixelDiff, qint32 *negativeSpanEndDistance, qint32 *positiveSpanEndDistance, qint32 *negativePixelDiff, qint32 *positivePixelDiff, bool *negativeSpanExtremeValid, bool *positiveSpanExtremeValid) const |
| Get the extreme points of the span for the current pixel. | |
| bool | getInterpolationValue (qint32 negativeSpanEndDistance, qint32 positiveSpanEndDistance, qint32 negativePixelDiff, qint32 positivePixelDiff, qint32 currentPixelDiff, bool negativeSpanExtremeValid, bool positiveSpanExtremeValid, qint32 *interpolationValue) const |
| Get a interpolation value to linearly interpolate the current pixel with its edge neighbor. | |
Static Private Attributes | |
| static constexpr qint32 | currentScanlineIndex {verticalBorderSize} |
| Offset of the current scanline in the buffer (The middle scanline). | |
| static constexpr qint32 | edgeThreshold {4} |
| Edges with gradient less than this value will not be antiAliased. | |
| static constexpr qint32 | horizontalBorderSize {2} |
| The size of the border added internally to the left and right of the scanline buffer so that we can read outside the selection rect without problems. It must be equal to the largest value in offsets. | |
| static constexpr qint32 | numberOfScanlines {2 * verticalBorderSize + 1} |
| Number of scanlines in the internal buffer. | |
| static constexpr qint32 | numSteps {30} |
| Number of steps to jump when searching for one of the ends of the antiAliased span. | |
| static constexpr qint32 | offsets [numSteps] |
| This array of numSteps size holds the number of pixels to jump in each step. | |
| static constexpr qint32 | verticalBorderSize {40} |
| The size of the border added internally to the top and bottom of the scanline buffer so that we can read outside the selection rect without problems. It must be equal to the sum of all values in offsets. | |
Additional Inherited Members | |
Protected Member Functions inherited from KisSelectionFilter | |
| void | computeBorder (qint32 *circ, qint32 xradius, qint32 yradius) |
| void | computeTransition (quint8 *transition, quint8 **buf, qint32 width) |
| void | rotatePointers (quint8 **p, quint32 n) |
AntiAlias filter for selections inspired by FXAA.
Definition at line 147 of file kis_selection_filters.h.
|
private |
Get the extreme point of the span for the current pixel in the given direction.
Definition at line 974 of file kis_selection_filters.cpp.
References currentScanlineIndex, horizontalBorderSize, numSteps, and offsets.
|
private |
Get the extreme points of the span for the current pixel.
Definition at line 1013 of file kis_selection_filters.cpp.
References findSpanExtreme().
|
private |
Get a interpolation value to linearly interpolate the current pixel with its edge neighbor.
Definition at line 933 of file kis_selection_filters.cpp.
References distance().
|
overridevirtual |
Reimplemented from KisSelectionFilter.
Definition at line 928 of file kis_selection_filters.cpp.
References kundo2_i18n().
|
overridevirtual |
Implements KisSelectionFilter.
Definition at line 1026 of file kis_selection_filters.cpp.
References currentScanlineIndex, KoColor::data(), KisPaintDevice::defaultPixel(), edgeThreshold, findSpanExtremes(), getInterpolationValue(), horizontalBorderSize, numberOfScanlines, KisPaintDevice::readBytes(), verticalBorderSize, and KisPaintDevice::writeBytes().
|
staticconstexprprivate |
Offset of the current scanline in the buffer (The middle scanline).
Definition at line 191 of file kis_selection_filters.h.
|
staticconstexprprivate |
Edges with gradient less than this value will not be antiAliased.
Definition at line 157 of file kis_selection_filters.h.
|
staticconstexprprivate |
The size of the border added internally to the left and right of the scanline buffer so that we can read outside the selection rect without problems. It must be equal to the largest value in offsets.
Definition at line 177 of file kis_selection_filters.h.
|
staticconstexprprivate |
Number of scanlines in the internal buffer.
Definition at line 187 of file kis_selection_filters.h.
|
staticconstexprprivate |
Number of steps to jump when searching for one of the ends of the antiAliased span.
Definition at line 162 of file kis_selection_filters.h.
|
staticconstexprprivate |
This array of numSteps size holds the number of pixels to jump in each step.
Definition at line 167 of file kis_selection_filters.h.
|
staticconstexprprivate |
The size of the border added internally to the top and bottom of the scanline buffer so that we can read outside the selection rect without problems. It must be equal to the sum of all values in offsets.
Definition at line 183 of file kis_selection_filters.h.