forked from kmkolasinski/AwesomeBump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformmaterialindicesmanager.h
60 lines (42 loc) · 1.42 KB
/
formmaterialindicesmanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef FORMMATERIALINDICESMANAGER_H
#define FORMMATERIALINDICESMANAGER_H
#include "formimageprop.h"
#include "formimagebase.h"
namespace Ui {
class FormMaterialIndicesManager;
}
typedef std::map<int,QRgb>::iterator it_type;
class FormMaterialIndicesManager : public FormImageBase
{
Q_OBJECT
public:
FormMaterialIndicesManager(QMainWindow *parent = 0, QGLWidget *qlW_ptr = 0 );
void setImage(QImage image);
~FormMaterialIndicesManager();
// Counts colors and manages material masking
bool updateMaterials(QImage &_image);
bool isEnabled();
void disableMaterials();
// just pointers to images
FormImageProp* imagesPointers[7];
public slots:
void changeMaterial(int index);
void pasteFromClipboard();
void copyToClipboard();
void toggleMaterials(bool toggle);// enable disable materials
void chooseMaterialByColor(QColor color);// takes a color then searches for similar in materials table
signals:
void materialChanged();
void imageLoaded(int width,int height);
void materialsToggled(bool);
protected:
bool loadFile(const QString &fileName);
void pasteImageFromClipboard(QImage& image);
// keep all the settings in one place
std::map<QString,FBOImageProporties> materialIndices[7];
std::map<int,QRgb> colorIndices;
int lastMaterialIndex;
Ui::FormMaterialIndicesManager *ui;
bool bSkipUpdating;
};
#endif // FORMMATERIALINDICESMANAGER_H