Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
985 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2014 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __KIS_POLYGONAL_GRADIENT_SHAPE_STRATEGY_H
#define __KIS_POLYGONAL_GRADIENT_SHAPE_STRATEGY_H

#include "kis_gradient_shape_strategy.h"

#include <QPainterPath>

#include "kritaimage_export.h"


class KRITAIMAGE_EXPORT KisPolygonalGradientShapeStrategy : public KisGradientShapeStrategy
{
public:
    KisPolygonalGradientShapeStrategy(const QPainterPath &selectionPath,
                                      qreal exponent);
    ~KisPolygonalGradientShapeStrategy() override;

    double valueAt(double x, double y) const override;

    static QPointF testingCalculatePathCenter(int numSamples, const QPainterPath &path, qreal exponent, bool searchForMax);

private:
    QPainterPath m_selectionPath;

    qreal m_exponent;
    qreal m_minWeight;
    qreal m_maxWeight;
    qreal m_scaleCoeff;
};

#endif /* __KIS_POLYGONAL_GRADIENT_SHAPE_STRATEGY_H */