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++
1.3 KB
Raw Blame
/*
 * SPDX-FileCopyrightText: 2015 Wolthera van Hövell tot Westerflier <[email protected]>
 *
 *  SPDX-License-Identifier: LGPL-2.0-or-later
 */
#ifndef KIS_TANGENTTILT_OPTION_DATA_H
#define KIS_TANGENTTILT_OPTION_DATA_H


#include "kis_types.h"
#include <boost/operators.hpp>

class KisPropertiesConfiguration;

enum TangentTiltDirectionType {
    Tilt,
    Direction,
    Rotation,
    Mix
};

struct KisTangentTiltOptionData : boost::equality_comparable<KisTangentTiltOptionData>
{
    inline friend bool operator==(const KisTangentTiltOptionData &lhs, const KisTangentTiltOptionData &rhs) {
        return lhs.redChannel == rhs.redChannel
            && lhs.greenChannel == rhs.greenChannel
            && lhs.blueChannel == rhs.blueChannel
            && lhs.directionType == rhs.directionType
            && qFuzzyCompare(lhs.elevationSensitivity, rhs.elevationSensitivity)
            && qFuzzyCompare(lhs.mixValue, rhs.mixValue);
    }

    int redChannel {0};
    int greenChannel {2};
    int blueChannel {4};
    TangentTiltDirectionType directionType {TangentTiltDirectionType::Tilt};
    double elevationSensitivity {100.0};
    double mixValue {50.0};

    bool read(const KisPropertiesConfiguration *setting);
    void write(KisPropertiesConfiguration *setting) const;
};

#endif // KIS_TANGENTTILT_OPTION_DATA_H