Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
addtransparencytopaperdialog.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2020 David Lamhauge
5
6This program is free software; you can redistribute it and/or
7modify it under the terms of the GNU General Public License
8as published by the Free Software Foundation; version 2 of the License.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15*/
16
17#ifndef ADDTRANSPARENCYTOPAPERDIALOG_H
18#define ADDTRANSPARENCYTOPAPERDIALOG_H
19
20#include <QDialog>
21#include <QGraphicsScene>
22
23#include "bitmapimage.h"
24
25class Editor;
26class QAbstractButton;
27class QGraphicsPixmapItem;
28
29namespace Ui {
30class AddTransparencyToPaperDialog;
31}
32
33class AddTransparencyToPaperDialog : public QDialog
34{
35 Q_OBJECT
36
37public:
38 explicit AddTransparencyToPaperDialog(QWidget *parent = nullptr);
39 ~AddTransparencyToPaperDialog() override;
40
41 void setCore(Editor* editor);
42
43 void initUI();
44
45 void traceScannedDrawings();
46
47protected:
48 void resizeEvent(QResizeEvent*) override;
49
50private slots:
51 void thresholdSpinboxChanged(int value);
52 void thresholdSliderChanged(int value);
53 void updateDrawing();
54 void layerChanged(int index);
55 void checkerStateChanged(bool state);
56 void zoomChanged(int zoomLevel);
57 void buttonClicked(QAbstractButton* button);
58
59private:
60 void updatePreview();
61 void loadDrawing(int frame);
62
63 int mZoomLevel = 1;
64
65 Ui::AddTransparencyToPaperDialog *ui = nullptr;
66
67 QGraphicsScene scene;
68 QGraphicsPixmapItem* mPreviewImageItem = nullptr;
69
70 int mThreshold = 220;
71 BitmapImage mBitmap;
72 QPixmap mPixmapFromImage;
73 Editor* mEditor = nullptr;
74};
75
76#endif // ADDTRANSPARENCYTOPAPERDIALOG_H
AddTransparencyToPaperDialog
Definition: addtransparencytopaperdialog.h:34
BitmapImage
Definition: bitmapimage.h:28
Editor
Definition: editor.h:71
QAbstractButton
QDialog
QGraphicsPixmapItem
QGraphicsScene
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPixmap
QResizeEvent
QWidget
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39