-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImpressionistDoc.h
106 lines (78 loc) · 2.42 KB
/
ImpressionistDoc.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
// impressionistDoc.h
//
// header file for Doc
//
#ifndef ImpressionistDoc_h
#define ImpressionistDoc_h
#include "impressionist.h"
#include "bitmap.h"
#include "FilterCustomize.h"
class ImpressionistUI;
class ImpressionistDoc
{
public:
ImpressionistDoc();
void setUI(ImpressionistUI* ui); // Assign the UI to use
int loadImage(char* iname); // called by the UI to load image
int saveImage(char* iname); // called by the UI to save image
int loadAnotherImage(char* iname);
int clearCanvas(); // called by the UI to clear the drawing canvas
int getBrushType();
void setBrushType(int type); // called by the UI to set the brushType
void setDirectionType(int type); // called by the UI to set the directionType
int getSize(); // get the UI size
void setLineAngle(int angle);
int getLineWidth(); // get the UI line width
int getLineAngle(); // get the UI line angle
int getAlpha(); // get the UI Alpha
double getColorR(); // get the UI ColorR
double getColorG(); // get the UI ColorG
double getColorB(); // get the UI ColorB
int getDirectionType(); // get the
void autoPaint();
void edgeDraw();
//right click
void rightStart(Point target);
void rightEnd(Point target);
int computeLineSize();
int computeLineAngle();
void setSize(int size); // set the UI size
char* getImageName(); // get the current image name
void setPicIntensity();
void applyCustomFilter(double* kernel, int w, int h, int button_val);
// Attributes
public:
//right click
Point rightStartPoint;
Point rightEndPoint;
// Dimensions of original window.
int m_nWidth,
m_nHeight;
// Dimensions of the paint window.
int m_nPaintWidth,
m_nPaintHeight;
// Bitmaps for original image and painting.
unsigned char* m_ucBitmap;
unsigned char* m_ucPainting;
int Gaussian_filter[3][3];
double** pic_intensity;//calculate picture intensity
// The current active brush.
ImpBrush* m_pCurrentBrush;
int m_nBrushType;
// Size of the brush.
int m_nSize;
int m_pDirectionType;
int m_nRandSpaceOnOff;
ImpressionistUI* m_pUI;
// Operations
public:
// Get the color of the original picture at the specified coord
GLubyte* GetOriginalPixel(int x, int y);
// Get the color of the original picture at the specified point
GLubyte* GetOriginalPixel(const Point p);
private:
char m_imageName[256];
};
extern void MessageBox(char* message);
#endif