Krita Source Code Documentation
Loading...
Searching...
No Matches
KoFilterEffectRenderContext.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2009 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
8#include "KoViewConverter.h"
9
10#include <QRectF>
11
13{
14public:
15 Private(const KoViewConverter &viewConverter)
16 : converter(viewConverter)
17 {}
18
20 QRectF shapeBound;
22};
23
28
33
35{
36 return d->filterRegion;
37}
38
39void KoFilterEffectRenderContext::setFilterRegion(const QRectF &filterRegion)
40{
41 d->filterRegion = filterRegion;
42}
43
45{
46 d->shapeBound = bound;
47}
48
50{
51 return QPointF(value.x()*d->shapeBound.width(), value.y()*d->shapeBound.height());
52}
53
55{
56 return value * d->shapeBound.width();
57}
58
60{
61 return value * d->shapeBound.height();
62}
63
65{
66 return &d->converter;
67}
float value(const T *src, size_t ch)
This class provides the render context for filter effects.
qreal toUserSpaceY(qreal value) const
Converts y-coordinate from bounding box coordinates to user space coordinates.
const KoViewConverter * viewConverter() const
Returns the view converter.
qreal toUserSpaceX(qreal value) const
Converts x-coordinate from bounding box coordinates to user space coordinates.
QPointF toUserSpace(const QPointF &value) const
Converts point from bounding box coordinates to user space coordinates.
void setFilterRegion(const QRectF &filterRegion)
Sets the filter region the filter is applied to.
KoFilterEffectRenderContext(const KoViewConverter &converter)
Private(const KoViewConverter &viewConverter)
void setShapeBoundingBox(const QRectF &bound)
Sets the shape bounding box used to convert to user space coordinates.