-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImpBrush.h
76 lines (59 loc) · 1.65 KB
/
ImpBrush.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
#ifndef IMPBRUSH_H
#define IMPBRUSH_H
//
// ImpBrush.h
//
// The header file of virtual brush. All the other brushes inherit from it.
//
#include <stdlib.h>
// Each brush type has an associated constant.
enum
{
BRUSH_POINTS = 0,
BRUSH_LINES = 1,
BRUSH_CIRCLES = 2,
BRUSH_SCATTERED_POINTS = 3,
BRUSH_SCATTERED_LINES = 4,
BRUSH_SCATTERED_CIRCLES = 5,
NUM_BRUSH_TYPE // Make sure this stays at the end!
};
// Each stroke direction type has an associated constant.
enum
{
STROKE_SLIDER = 0,
STROKE_RIGHTMOUSE = 1,
STROKE_BRUSH_DIRECTION = 2,
STROKE_GRADIENT = 3,
NUM_STROKE_DIRECTION
};
class ImpressionistDoc; // Pre-declaring class
class Point
{
public:
Point() {};
Point(int xx, int yy) { x = xx; y = yy; };
int x, y;
};
class ImpBrush
{
protected:
ImpBrush::ImpBrush( ImpressionistDoc* pDoc = NULL, char* name = NULL );
public:
// The implementation of your brush should realize these virtual functions
virtual void BrushBegin( const Point source, const Point target ) = 0;
virtual void BrushMove( const Point source, const Point target ) = 0;
virtual void BrushEnd( const Point source, const Point target ) = 0;
// according to the source image and the position, determine the draw color
void SetColor( const Point source );
// get Doc to communicate with it
ImpressionistDoc* GetDocument( void );
// Return the name of the brush (not used in this version).
char* BrushName( void );
static int c_nBrushCount; // How many brushes we have,
static ImpBrush** c_pBrushes; // and what they are.
private:
ImpressionistDoc* m_pDoc;
// Brush's name (not used in this version).
char* m_pBrushName;
};
#endif