File indexing completed on 2024-05-12 15:58:23

0001 /*
0002  *  SPDX-FileCopyrightText: 2015 Jouni Pentikäinen <joupent@gmail.com>
0003  *  SPDX-FileCopyrightText: 2020 Emmet O 'Neill <emmetoneill.pdx@gmail.com>
0004  *  SPDX-FileCopyrightText: 2020 Eoin O 'Neill <eoinoneill1991@gmail.com>
0005  *
0006  *  SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #ifndef KIS_KEYFRAME_H
0010 #define KIS_KEYFRAME_H
0011 
0012 #include <qglobal.h>
0013 #include <qmetatype.h>
0014 #include <QScopedPointer>
0015 
0016 #include "kritaimage_export.h"
0017 #include "kis_types.h"
0018 
0019 class KisKeyframeChannel;
0020 
0021 /** @brief Krita's base keyframe class.
0022  * Mainly contained by KisKeyframeChannels.
0023  * A core part of Krita's animation bankend.
0024  */
0025 class KRITAIMAGE_EXPORT KisKeyframe : public QObject {
0026     Q_OBJECT
0027 public:
0028     KisKeyframe();
0029     virtual ~KisKeyframe();
0030 
0031     int colorLabel() const;
0032     void setColorLabel(int colorIndex);
0033 
0034     /** Creates a copy of this keyframe.
0035      * @param  newChannel  (Optional) The channel that will hold this duplicate.
0036      * This is used when some action must be taken to insert a frame into a new channel,
0037      * for example, the registration of a KisRasterKeyframe with the new channel's paint device. */
0038     virtual KisKeyframeSP duplicate(class KisKeyframeChannel* newChannel = nullptr) = 0;
0039 
0040 private:
0041     struct Private;
0042     QScopedPointer<Private> m_d;
0043 };
0044 
0045 #endif