|
Krita Source Code Documentation
|
#include <kis_filter_weights_applicator.h>
Classes | |
| struct | BlendSpan |
| class | LinePos |
Public Member Functions | |
| BlendSpan | calculateBlendSpan (int dst_l, int line, KisFilterWeightsBuffer *buffer) const |
| KisFilterWeightsApplicator (KisPaintDeviceSP src, KisPaintDeviceSP dst, qreal realScale, qreal shear, qreal dx, bool clampToEdge) | |
| template<class T > | |
| LinePos | processLine (LinePos srcLine, int line, KisFilterWeightsBuffer *buffer, qreal filterSupport) |
Private Member Functions | |
| KisFixedPoint | c_to_l (KisFixedPoint pixel_c) const |
| qreal | dstToSrc (qreal dst, int line) const |
| int | findAntialiasedDstEnd (int src_l, qreal support, int line) |
| int | findAntialiasedDstStart (int src_l, qreal support, int line) |
| int | getLeftSrcNeedBorder (int dst_l, int line, KisFilterWeightsBuffer *buffer) |
| int | getRightSrcNeedBorder (int dst_l, int line, KisFilterWeightsBuffer *buffer) |
| KisFixedPoint | l_to_c (KisFixedPoint pixel_l) const |
| qreal | srcToDst (qreal src, int line) const |
Private Attributes | |
| bool | m_clampToEdge |
| KisPaintDeviceSP | m_dst |
| qreal | m_dx |
| qreal | m_realScale |
| qreal | m_shear |
| KisPaintDeviceSP | m_src |
This is a main class for transforming a line of pixel data. It transforms lines from src into dst using scale, shear and offset (dx) parameters.
Notation: <pixel_name>_l – leftmost border of the pixel <pixel_name>_c – center of the pixel
Example calculation of an offset (see calculateBlendSpan()): scale = 0.5; offset = <very small value>
+------ dst_l
|
| +-- dst_c
| |
dst: | * | * | * |
src: | * | * | * | * | * | * | * | * |
|||
||+--- next_c_in_src
|||
|+---- dst_c_in_src
|||
|++--- offset (near zero, measured in dst coordinates)
|
+-- _l position of the pixel, which is considered
central in the weights buffer
Another example calculation of an offset (see calculateBlendSpan()): scale = 0.5; offset = <high value near 0.5>
+------ dst_l
|
| +-- dst_c
| |
dst: | * | * | * |
src: | * | * | * | * | * | * | * | * |
|| |
|| +--- next_c_in_src
|| |
+------ dst_c_in_src
|| |
+|-+--- offset (near 0.5, measured in dst coordinates)
|
+-- _l position of the pixel, which is considered
central in the weights buffer
Definition at line 94 of file kis_filter_weights_applicator.h.
|
inline |
Definition at line 97 of file kis_filter_weights_applicator.h.
|
inlineprivate |
Definition at line 317 of file kis_filter_weights_applicator.h.
|
inline |
Definition at line 118 of file kis_filter_weights_applicator.h.
References KisFilterWeightsBuffer::FilterWeights::centerIndex, dstToSrc(), KisFilterWeightsApplicator::BlendSpan::firstBlendPixel, l_to_c(), KisFilterWeightsApplicator::BlendSpan::offset, KisFilterWeightsApplicator::BlendSpan::offsetInc, KisFixedPoint::toFloat(), KisFixedPoint::toIntFloor(), KisFilterWeightsApplicator::BlendSpan::weights, KisFilterWeightsBuffer::weights(), and KisFilterWeightsBuffer::weightsPositionScale().
|
inlineprivate |
Definition at line 325 of file kis_filter_weights_applicator.h.
References m_dx, m_realScale, and m_shear.
|
inlineprivate |
Definition at line 298 of file kis_filter_weights_applicator.h.
References m_clampToEdge, and srcToDst().
|
inlineprivate |
Definition at line 293 of file kis_filter_weights_applicator.h.
References m_clampToEdge, and srcToDst().
|
inlineprivate |
Definition at line 303 of file kis_filter_weights_applicator.h.
References calculateBlendSpan(), and KisFilterWeightsApplicator::BlendSpan::firstBlendPixel.
|
inlineprivate |
Definition at line 308 of file kis_filter_weights_applicator.h.
References calculateBlendSpan(), KisFilterWeightsApplicator::BlendSpan::firstBlendPixel, KisFilterWeightsBuffer::FilterWeights::span, and KisFilterWeightsApplicator::BlendSpan::weights.
|
inlineprivate |
Definition at line 313 of file kis_filter_weights_applicator.h.
|
inline |
Since we are rounding the borders of the line we might end up to squashing our line into a single pixel. In such a case we should correct our line to be exactly one pixel
Since we are rounding the borders of the line we might end up to squashing our line into a single pixel. In such a case we should correct our line to be exactly one pixel
Definition at line 187 of file kis_filter_weights_applicator.h.
References calculateBlendSpan(), KisPaintDevice::colorSpace(), KoColor::data(), KisPaintDevice::defaultPixel(), KisFilterWeightsApplicator::LinePos::end(), findAntialiasedDstEnd(), findAntialiasedDstStart(), KisFilterWeightsApplicator::BlendSpan::firstBlendPixel, getLeftSrcNeedBorder(), getRightSrcNeedBorder(), m_clampToEdge, m_dst, m_realScale, m_src, KisFilterWeightsBuffer::maxSpan(), KoMixColorsOp::mixColors(), KoColorSpace::mixColorsOp, KisPaintDevice::pixelSize(), KisFilterWeightsApplicator::LinePos::size(), KisFilterWeightsBuffer::FilterWeights::span, KisFilterWeightsApplicator::LinePos::start(), KisFilterWeightsBuffer::FilterWeights::weight, and KisFilterWeightsApplicator::BlendSpan::weights.
|
inlineprivate |
Definition at line 321 of file kis_filter_weights_applicator.h.
References m_dx, m_realScale, and m_shear.
|
private |
Definition at line 336 of file kis_filter_weights_applicator.h.
|
private |
Definition at line 331 of file kis_filter_weights_applicator.h.
|
private |
Definition at line 335 of file kis_filter_weights_applicator.h.
|
private |
Definition at line 333 of file kis_filter_weights_applicator.h.
|
private |
Definition at line 334 of file kis_filter_weights_applicator.h.
|
private |
Definition at line 330 of file kis_filter_weights_applicator.h.