MP4
Stacks and Queues
|
colorPicker: a functor that determines the color that should be used given an x and y coordinate. More...
#include "colorPicker.h"
Public Member Functions | |
virtual | ~colorPicker () |
Destructor: does nothing, but as it is virtual, you may overload it in derived classes if needed. More... | |
virtual RGBAPixel | operator() (int x, int y)=0 |
Picks the color for pixel (x, y). More... | |
colorPicker: a functor that determines the color that should be used given an x and y coordinate.
|
inlinevirtual |
Destructor: does nothing, but as it is virtual, you may overload it in derived classes if needed.
|
pure virtual |
Picks the color for pixel (x, y).
This function must be defined in the subclass! It chooses a color for the given point (x,y) and returns it.
For example, the gridColorPicker::operator()() function is defined so as to return a color if x or y is divisible by the grid spacing, and white otherwise. In this way, if you colored each pixel in an image whatever color the gridColorPicker chose, you would end up with a grid.
For the other patterns, you will have to figure out how to "pick" the colors.
x | The x coordinate of the pixel we want to pick a color for. |
y | The y coordinate of the pixel we want to pick a color for. |
Implemented in gradientColorPicker, gridColorPicker, solidColorPicker, and rainbowColorPicker.