Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
PNMBrush Class Reference

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:
ReferenceCount MemoryBase PNMImageBrush PNMPixelBrush PNMTransparentBrush PNMBlendImageBrush PNMDarkenImageBrush PNMLightenImageBrush PNMSetImageBrush PNMBlendPixelBrush PNMDarkenPixelBrush PNMLightenPixelBrush PNMSetPixelBrush

List of all members.

Public Types

enum  BrushEffect { BE_set, BE_blend, BE_darken, BE_lighten }

Public Member Functions

virtual void draw (PNMImage &image, int x, int y, double pixel_scale)=0
virtual void fill (PNMImage &image, int xfrom, int xto, int y, int xo, int yo)=0
double get_xc () const
 Returns the coordinates of the brush's center pixel.
double get_yc () const
 Returns the coordinates of the brush's center pixel.

Static Public Member Functions

static PT (PNMBrush) make_transparent()
static PT (PNMBrush) make_pixel(const LColord &color
static PT (PNMBrush) make_spot(const LColord &color
static PT (PNMBrush) make_image(const PNMImage &image

Public Attributes

static BrushEffect effect = BE_blend)
static double bool BrushEffect effect = BE_blend)
static double double BrushEffect effect = BE_blend)
static double bool fuzzy
static double radius
static double xc
static double double yc

Protected Member Functions

 PNMBrush (double xc, double yc)

Protected Attributes

double _xc
double _yc

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 41 of file pnmBrush.h.


Member Function Documentation

double 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 35 of file pnmBrush.I.

double 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 49 of file pnmBrush.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations