Panda3D

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PNMBrush Class Referenceabstract

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

`#include "pnmBrush.h"`

Inheritance diagram for PNMBrush:

## Public Types
enum | BrushEffect { BE_set , BE_blend , BE_darken , BE_lighten }

## Public Member Functions
virtual void | draw (PNMImage &image, int x, int y, float pixel_scale)=0
virtual void | fill (PNMImage &image, int xfrom, int xto, int y, int xo, int yo)=0
float | get_xc () const
| Returns the coordinates of the brush's center pixel. More...
float | get_yc () const
| Returns the coordinates of the brush's center pixel. More...
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object. More...
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
void | ref () const
| Explicitly increments the reference count. More...
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero. More...
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus. More...
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
virtual bool | unref () const
| Explicitly decrements the reference count. More...
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one. More...
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object. More...
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object. More...
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

## Static Public Member Functions
static | PT (PNMBrush) make_image(const PNMImage &image
static | PT (PNMBrush) make_pixel(const LColorf &color
static | PT (PNMBrush) make_spot(const LColorf &color
static | PT (PNMBrush) make_transparent()
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()

## Public Attributes
static BrushEffect | effect = BE_blend)
static float bool BrushEffect | effect = BE_blend)
static float float BrushEffect | effect = BE_blend)
static float bool | fuzzy
static float | radius
static float | xc
static float float | yc
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count. More...

## 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.

Definition at line 36 of file pnmBrush.h.

## Member Function Documentation

## ◆ get_xc()

float PNMBrush::get_xc | ( |  | ) | const
| inline

Returns the coordinates of the brush's center pixel.

For a one-pixel brush, this will be (0.5, 0.5); for a centered two-pixel brush, this will be (1.0, 1.0); for a centered three-pixel brush, this will be (1.5, 1.5); and so on.

Definition at line 27 of file pnmBrush.I.

## ◆ get_yc()

float PNMBrush::get_yc | ( |  | ) | const
| inline

Returns the coordinates of the brush's center pixel.

For a one-pixel brush, this will be (0.5, 0.5); for a centered two-pixel brush, this will be (1.0, 1.0); for a centered three-pixel brush, this will be (1.5, 1.5); and so on.

Definition at line 38 of file pnmBrush.I.

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

- panda/src/pnmimage/pnmBrush.h
- panda/src/pnmimage/pnmBrush.cxx
- panda/src/pnmimage/pnmBrush.I