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.0 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2022 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */
#ifndef KISCOLORSOURCEOPTIONDATA_H
#define KISCOLORSOURCEOPTIONDATA_H


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

class KisPropertiesConfiguration;

struct PAINTOP_EXPORT KisColorSourceOptionData : boost::equality_comparable<KisColorSourceOptionData>
{
    enum Type {
        PLAIN,
        GRADIENT,
        UNIFORM_RANDOM,
        TOTAL_RANDOM,
        PATTERN,
        PATTERN_LOCKED
    };

    inline friend bool operator==(const KisColorSourceOptionData &lhs, const KisColorSourceOptionData &rhs) {
        return lhs.type == rhs.type;
    }

    Type type {PLAIN};

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

    static QVector<KoID> colorSourceTypeIds();
    static KoID type2Id(Type type);
    static Type id2Type(const KoID &id);
};

#endif // KISCOLORSOURCEOPTIONDATA_H