Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Static Public Member Functions

# PNMBrush Class Reference

This class is used to control the shape and color of the drawing operations performed by a PNMPainter object. More...

Inheritance diagram for PNMBrush:

List of all members.

## Public Types
enum | BrushEffect { BESet = 0, BEBlend = 1, BEDarken = 2, BELighten = 3 }
## Static Public Member Functions
static PNMBrush | makeImage (PNMImage const image, double xc, double yc, BrushEffect effect)
| Returns a new brush that paints with the indicated image.
static PNMBrush | makeImage (PNMImage const image, double xc, double yc)
| Returns a new brush that paints with the indicated image.
static PNMBrush | makePixel (VBase4D const color)
| Returns a new brush that paints a single pixel of the indicated color on a border, or paints a solid color in an interior.
static PNMBrush | makePixel (VBase4D const color, BrushEffect effect)
| Returns a new brush that paints a single pixel of the indicated color on a border, or paints a solid color in an interior.
static PNMBrush | makeSpot (VBase4D const color, double radius, bool fuzzy, BrushEffect effect)
| Returns a new brush that paints a spot of the indicated color and radius.
static PNMBrush | makeSpot (VBase4D const color, double radius, bool fuzzy)
| Returns a new brush that paints a spot of the indicated color and radius.
static PNMBrush | makeTransparent ()
| Returns a new brush that does not paint anything.

## Detailed Description

This class is used to control the shape and color of the drawing operations performed by a PNMPainter object.

Normally, you don't create a PNMBrush directly; instead, use one of the static PNMBrush.make_*() methods provided here.

A PNMBrush is used to draw the border of a polygon or rectangle, as well as for filling its interior. When it is used to draw a border, the brush is "smeared" over the border; when it is used to fill the interior, it is tiled through the interior.

## Member Enumeration Documentation

enum BrushEffect

Enumerator:

  BESet |
  BEBlend |
  BEDarken |
  BELighten |

## Member Function Documentation

static PNMBrush makeImage | ( | PNMImage const | image,
|  | double | xc,
|  | double | yc,
|  | BrushEffect | effect
| ) |  | `[static]`

Returns a new brush that paints with the indicated image.

xc and yc indicate the pixel in the center of the brush.

The brush makes a copy of the image; it is safe to deallocate or modify the image after making this call.

static PNMBrush makeImage | ( | PNMImage const | image,
|  | double | xc,
|  | double | yc
| ) |  | `[static]`

Returns a new brush that paints with the indicated image.

xc and yc indicate the pixel in the center of the brush.

The brush makes a copy of the image; it is safe to deallocate or modify the image after making this call.

static PNMBrush makePixel | ( | VBase4D const | color | ) | `[static]`

Returns a new brush that paints a single pixel of the indicated color on a border, or paints a solid color in an interior.

static PNMBrush makePixel | ( | VBase4D const | color,
|  | BrushEffect | effect
| ) |  | `[static]`

Returns a new brush that paints a single pixel of the indicated color on a border, or paints a solid color in an interior.

static PNMBrush makeSpot | ( | VBase4D const | color,
|  | double | radius,
|  | bool | fuzzy,
|  | BrushEffect | effect
| ) |  | `[static]`

Returns a new brush that paints a spot of the indicated color and radius.

If fuzzy is true, the spot is fuzzy; otherwise, it is hard-edged.

static PNMBrush makeSpot | ( | VBase4D const | color,
|  | double | radius,
|  | bool | fuzzy
| ) |  | `[static]`

Returns a new brush that paints a spot of the indicated color and radius.

If fuzzy is true, the spot is fuzzy; otherwise, it is hard-edged.

static PNMBrush makeTransparent | ( |  | ) | `[static]`

Returns a new brush that does not paint anything.

Can be used as either a pen or a fill brush to make borderless or unfilled shapes, respectively.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties