MP4
Stacks and Queues
Public Member Functions | List of all members
rainbowColorPicker Class Reference
Inheritance diagram for rainbowColorPicker:
colorPicker

Public Member Functions

virtual RGBAPixel operator() (int x, int y)
 Picks the color for pixel (x, y). More...
 
- Public Member Functions inherited from colorPicker
virtual ~colorPicker ()
 Destructor: does nothing, but as it is virtual, you may overload it in derived classes if needed.
 

Member Function Documentation

RGBAPixel rainbowColorPicker::operator() ( int  x,
int  y 
)
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.

Parameters
xThe x coordinate of the pixel we want to pick a color for.
yThe y coordinate of the pixel we want to pick a color for.
Returns
The color that the pixel at (x, y) should be.

Implements colorPicker.


The documentation for this class was generated from the following files: