Panda3D

Loading...
Searching...
No Matches
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.
float | get_yc () const
| Returns the coordinates of the brush's center pixel.
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.
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.

## 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 Enumeration Documentation

## ◆ BrushEffect

enum PNMBrush::BrushEffect

Definition at line 43 of file pnmBrush.h.

## Constructor & Destructor Documentation

## ◆ ~PNMBrush()

PNMBrush::~PNMBrush | ( |  | ) |
| virtual

Definition at line 250 of file pnmBrush.cxx.

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

## Member Data Documentation

## ◆ effect [1/3]

BrushEffect PNMBrush::effect = BE_blend)

Definition at line 51 of file pnmBrush.h.

## ◆ effect [2/3]

float bool BrushEffect PNMBrush::effect = BE_blend)

Definition at line 53 of file pnmBrush.h.

## ◆ effect [3/3]

float float BrushEffect PNMBrush::effect = BE_blend)

Definition at line 55 of file pnmBrush.h.

## ◆ fuzzy

float bool PNMBrush::fuzzy

Definition at line 52 of file pnmBrush.h.

## ◆ radius

float PNMBrush::radius

Definition at line 52 of file pnmBrush.h.

## ◆ xc

float PNMBrush::xc

Definition at line 54 of file pnmBrush.h.

## ◆ yc

float float PNMBrush::yc

Definition at line 54 of file pnmBrush.h.

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