MP4
Stacks and Queues
gridColorPicker Class Reference

gridColorPicker: a functor that determines the color that should be used given an x and a y coordinate using a grid pattern. More...

#include "gridColorPicker.h"

+ Inheritance diagram for gridColorPicker:
+ Collaboration diagram for gridColorPicker:

Public Member Functions

 gridColorPicker (RGBAPixel fillColor, int gridSpacing)
 Constructs a new gridColorPicker. More...
 
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. More...
 

Private Attributes

RGBAPixel color
 Color used for the grid border. More...
 
int spacing
 Spacing for cells in the grid. More...
 

Detailed Description

gridColorPicker: a functor that determines the color that should be used given an x and a y coordinate using a grid pattern.

Author
CS 225 Staff
Date
Fall 2010

Constructor & Destructor Documentation

gridColorPicker::gridColorPicker ( RGBAPixel  fillColor,
int  gridSpacing 
)

Constructs a new gridColorPicker.

Parameters
fillColorColor for the border between cells of the grid.
gridSpacingSpacing between cells of the grid.

Member Function Documentation

RGBAPixel gridColorPicker::operator() ( int  x,
int  y 
)
virtual

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.

Parameters
xThe x coordinate to pick a color for.
yThe y coordinat to pick a color for.
Returns
The color chosen for (x, y).

Implements colorPicker.

Member Data Documentation

RGBAPixel gridColorPicker::color
private

Color used for the grid border.

int gridColorPicker::spacing
private

Spacing for cells in the grid.


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