File indexing completed on 2024-05-12 15:56:40

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2009 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KOFILTEREFFECTRENDERCONTEXT_H
0008 #define KOFILTEREFFECTRENDERCONTEXT_H
0009 
0010 #include "kritaflake_export.h"
0011 
0012 #include <QtGlobal>
0013 
0014 class QRectF;
0015 class QPointF;
0016 class KoViewConverter;
0017 
0018 /// This class provides the render context for filter effects
0019 class KRITAFLAKE_EXPORT KoFilterEffectRenderContext
0020 {
0021 public:
0022     explicit KoFilterEffectRenderContext(const KoViewConverter &converter);
0023     ~KoFilterEffectRenderContext();
0024 
0025     /// Returns the filter region the filter is applied to
0026     QRectF filterRegion() const;
0027 
0028     /// Sets the filter region the filter is applied to
0029     void setFilterRegion(const QRectF &filterRegion);
0030 
0031     /// Sets the shape bounding box used to convert to user space coordinates
0032     void setShapeBoundingBox(const QRectF &bound);
0033 
0034     /// Converts point from bounding box coordinates to user space coordinates
0035     QPointF toUserSpace(const QPointF &value) const;
0036 
0037     /// Converts x-coordinate from bounding box coordinates to user space coordinates
0038     qreal toUserSpaceX(qreal value) const;
0039 
0040     /// Converts y-coordinate from bounding box coordinates to user space coordinates
0041     qreal toUserSpaceY(qreal value) const;
0042 
0043     /// Returns the view converter
0044     const KoViewConverter *viewConverter() const;
0045 
0046 private:
0047     class Private;
0048     Private * const d;
0049 };
0050 
0051 #endif // KOFILTEREFFECTRENDERCONTEXT_H