Public Member Functions | Protected Member Functions | Protected Attributes

Brush Class Reference

This is the superclass for all brushes. More...

#include <Brush.h>

Inherited by ConstantBrush, LinearBrush, and QuadraticBrush.

Collaboration diagram for Brush:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

This is the superclass for all brushes.

Part of the CS123 support code.

Author:
Evan Wallace (edwallac)
Ben Herila (bherila)
Date:
9/1/2010

Member Function Documentation

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.


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