-
Notifications
You must be signed in to change notification settings - Fork 2
/
PColourWheel.h
51 lines (40 loc) · 1.48 KB
/
PColourWheel.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
//==============================================================================
// File: PColourWheel.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __PColourWheel_h__
#define __PColourWheel_h__
#include "PImageCanvas.h"
class PColourWheel : public PImageCanvas {
public:
PColourWheel(PImageWindow *owner, Widget canvas=0, int size=100);
virtual ~PColourWheel();
virtual void DrawSelf();
virtual void AfterDrawing();
virtual void HandleEvents(XEvent *event);
virtual void Listen(int message, void *dataPt);
void SetIntensity(int val, int fastAnimate=0);
void AnimateDone();
void SetColourRGB(int *col3);
void GetColourRGB(int *col3);
int GetIntensity() { return mIntensity; }
private:
void SetCursorPos(int x, int y);
void CursorMoved();
void DrawTheWheel();
void TestColours();
void AllocColours();
void FreeColours();
Pixel * mColours;
char * mAllocFlags;
int mIntensity;
int mCurX, mCurY;
int mWheelSize;
int mColourType;
float mMaxColour[3];
XImage * mImage;
int mFirstTry;
int mDelayedUpdate;
};
#endif // __PColourWheel_h__