Panda3D

- Main Page
- Packages
- Classes

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

Public Member Functions

# PNMPainter Class Reference

This class provides a number of convenient methods for painting drawings directly into a PNMImage. More...

List of all members.

## Public Member Functions
| PNMPainter (PNMImage image, int xo, int yo)
| The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.
| PNMPainter (PNMImage image, int xo)
| The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.
| PNMPainter (PNMImage image)
| The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.
| drawLine (double xa, double ya, double xb, double yb)
| Draws an antialiased line on the PNMImage, using the current pen.
| drawPoint (double x, double y)
| Draws an antialiased point on the PNMImage, using the current pen.
| drawRectangle (double xa, double ya, double xb, double yb)
| Draws a filled rectangule on the PNMImage, using the current pen for the outline, and the current fill brush for the interior.
PNMBrush | getFill ()
| Returns the current fill brush.
PNMBrush | getPen ()
| Returns the current pen.
| setFill (PNMBrush fill)
| Specifies a PNMBrush that will be used for filling in the interiors of objects.
| setPen (PNMBrush pen)
| Specifies a PNMBrush that will be used for drawing lines and edges.

## Detailed Description

This class provides a number of convenient methods for painting drawings directly into a PNMImage.

It stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.

## Constructor & Destructor Documentation

PNMPainter | ( | PNMImage | image,
|  | int | xo,
|  | int | yo
| ) |  |

The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.

The xo, yo coordinates specify an optional offset for fill coordinates. If you are painting with a pattern fill, these specify the virtual coordinates of the upper-left corner of the image, which can allow you to adjust the pattern to line up with nested images, if necessary.

PNMPainter | ( | PNMImage | image,
|  | int | xo
| ) |  |

The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.

The xo, yo coordinates specify an optional offset for fill coordinates. If you are painting with a pattern fill, these specify the virtual coordinates of the upper-left corner of the image, which can allow you to adjust the pattern to line up with nested images, if necessary.

PNMPainter | ( | PNMImage | image | ) |

The constructor stores a pointer to the PNMImage you pass it, but it does not take ownership of the object; you are responsible for ensuring that the PNMImage does not destruct during the lifetime of the PNMPainter object.

The xo, yo coordinates specify an optional offset for fill coordinates. If you are painting with a pattern fill, these specify the virtual coordinates of the upper-left corner of the image, which can allow you to adjust the pattern to line up with nested images, if necessary.

## Member Function Documentation

drawLine | ( | double | xa,
|  | double | ya,
|  | double | xb,
|  | double | yb
| ) |  |

Draws an antialiased line on the PNMImage, using the current pen.

drawPoint | ( | double | x,
|  | double | y
| ) |  |

Draws an antialiased point on the PNMImage, using the current pen.

drawRectangle | ( | double | xa,
|  | double | ya,
|  | double | xb,
|  | double | yb
| ) |  |

Draws a filled rectangule on the PNMImage, using the current pen for the outline, and the current fill brush for the interior.

The two coordinates specify any two diagonally opposite corners.

PNMBrush getFill | ( |  | ) |

Returns the current fill brush.

See set_fill().

PNMBrush getPen | ( |  | ) |

Returns the current pen.

See set_pen().

setFill | ( | PNMBrush | fill | ) |

Specifies a PNMBrush that will be used for filling in the interiors of objects.

If the brush is a bitmap brush, its image will be tiled throughout the space.

Unlike the PNMImage passed to the constructor, the PNMPainter will take ownership of the fill brush. It is not necessary to keep a separate pointer to it.

setPen | ( | PNMBrush | pen | ) |

Specifies a PNMBrush that will be used for drawing lines and edges.

If the brush is a bitmap brush, its image will be smeared pixelwise along the line.

Unlike the PNMImage passed to the constructor, the PNMPainter will take ownership of the pen. It is not necessary to keep a separate pointer to it.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties