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.4 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2021 Eoin O 'Neill <[email protected]>
 *  SPDX-FileCopyrightText: 2021 Emmet O 'Neill <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KIS_PROPERTY_WRAPPER_H
#define KIS_PROPERTY_WRAPPER_H

#include <QObject>
#include <QVariant>

#include "kis_scalar_keyframe_channel.h"
#include "kis_time_span.h"
#include "kis_image.h"
#include "KoProperties.h"

#include "kritaimage_export.h"

class KRITAIMAGE_EXPORT KisAnimatedOpacityProperty : public QObject {
    Q_OBJECT
public:
    KisAnimatedOpacityProperty(KisDefaultBoundsBaseSP bounds, KoProperties* const props, quint8 defaultValue, QObject *parent = nullptr);

    quint8 get();
    void set(const quint8 value);

    bool hasChannel() { return !m_channel.isNull(); }
    KisScalarKeyframeChannel* channel() const { return m_channel.data(); }

    void makeAnimated(KisNode* parentNode);
    void transferKeyframeData(const KisAnimatedOpacityProperty &rhs);

    void updateDefaultBounds(KisDefaultBoundsBaseSP bounds);

Q_SIGNALS:
    void changed(quint8 value);

public Q_SLOTS:
    void slotKeyChanged(const KisKeyframeChannel*, int time);
    void slotKeyRemoval(const KisKeyframeChannel*, int);

private:
    KisDefaultBoundsBaseSP m_bounds;
    KoProperties* const m_props;
    QScopedPointer<KisScalarKeyframeChannel> m_channel;
    quint8 m_defaultValue;
};

#endif // KISLAMBDAPROPERTY_H