This is the superclass for all brushes. More...
#include <Brush.h>
Inherited by ConstantBrush, LinearBrush, and QuadraticBrush.

Public Member Functions | |
| Brush (BGRA color, int flow, int radius) | |
| Constructor for brush. Pass it the initial color, flow and radius. | |
| virtual | ~Brush () |
| Destructor for brush. Clean up all brush allocated resources. | |
| void | setRed (int red) |
| Set the red channel of the brush color. | |
| void | setGreen (int green) |
| Set the green channel of the brush color. | |
| void | setBlue (int blue) |
| Set the blue channel of the brush color. | |
| void | setFlow (int flow) |
| Set the flow of the brush. | |
| void | setRadius (int radius) |
| Set the radius of the brush. | |
| virtual void | paintOnce (int x, int y, Canvas2D *canvas) |
| Apply the brush one time to the given canvas centered at (x,y). | |
Protected Member Functions | |
| virtual void | makeMask ()=0 |
Protected Attributes | |
| BGRA | m_color |
| This is a pointer to the brush mask. | |
| int | m_flow |
| The color for the current brush. | |
| int | m_radius |
| The flow setting of the brush. | |
This is the superclass for all brushes.
Part of the CS123 support code.
| virtual void Brush::makeMask | ( | ) | [protected, pure virtual] |
Pure virtual function that will create the mask distribution. Will be implemented in the subclass.
Implemented in ConstantBrush, LinearBrush, QuadraticBrush, and SmudgeBrush.
1.7.1