-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstripeColorPicker.h
43 lines (38 loc) · 1.11 KB
/
stripeColorPicker.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
/**
* @file stripeColorPicker.h
* Definition of a stripe color picker.
*
*/
#ifndef STRIPECOLORPICKER_H
#define STRIPECOLORPICKER_H
#include "colorPicker.h"
/**
* stripeColorPicker: a functor that determines the color that should be used
* given an x and a y coordinate using a stripe pattern.
*
*/
class stripeColorPicker : public colorPicker
{
public:
/**
* Constructs a new stripeColorPicker.
*
* @param fillColor Color for the stripes.
* @param stripeSpacing space between the stripes
*/
stripeColorPicker(HSLAPixel fillColor, int stripeSpacing);
/**
* Picks the color for pixel (x, y). If the x or y coordinate is a
* multiple of the spacing, it will be filled with the fillColor.
* otherwise, it will be filled with white.
*
* @param x The x coordinate to pick a color for.
* @param y The y coordinat to pick a color for.
* @return The color chosen for (x, y).
*/
virtual HSLAPixel operator()(int x, int y);
private:
HSLAPixel color; /**< Color used for the stripe. */
int spacing; /**< Space between stripes. */
};
#endif