Debian Codegraph @

libUnionImage/UnionImage/giflib/unused/cmanagerattributeservice.h

raw
1 /*
2 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
3 *
4 * Author: ZhangYong <[email protected]>
5 *
6 * Maintainer: ZhangYong <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef CMANAGERATTRIBUTESERVICE_H
22 #define CMANAGERATTRIBUTESERVICE_H
23
24 #include "giflib/gif_lib.h"
25 #include <QObject>
26 #include <QImage>
27 #include <QMap>
28 #include <QTime>
29 #include <QThread>
30 /*
31 * @bref: CManagerAttributeService
32 */
33 class CManagerAttributeService : public QObject
34 {
35 Q_OBJECT
36 public:
37 static CManagerAttributeService *getInstance();
38 void setfilePathWithSignalPlay(const QString &path);
39 void setfilePath(const QString &path);
40 void setCouldRun(bool couldRun);
41 inline QImage getImage()
42 {
43 return m_pImg;
44 }
45 signals:
46 void emitImageSignal(QImage image, bool isFirst);
47 private:
48 CManagerAttributeService();
49 static CManagerAttributeService *instance;
50 public:
51 int32_t GifLoadFile(void);
52 void GifFreeFile(void);//release gif
53 int32_t GifFrameShow(void);
54 int32_t GifFrameShowSingle(void);
55 void GifScreenBufferToRgb888(ColorMapObject *ColorMap, uint8_t *inRgb,
56 GifRowType *ScreenBuffer, int32_t ScreenWidth, int32_t ScreenHeight,
57 int alphaIndex = 0);
58 private:
59 GifRecordType gRecordType = UNDEFINED_RECORD_TYPE;
60 GifRowType *gpScreenBuffer = nullptr;
61 GifFileType *gpGifFile = nullptr;
62 QString gEffectGifFile = "";
63 QImage m_pImg;
64 QImage first;
65 int tras;
66 bool m_couldRun = true;
67 bool m_isFirst = true;
68 QTime m_time;
69 QThread *m_th = nullptr;
70 };
71
72 #endif // CMANAGERATTRIBUTESERVICE_H