95 INLINE
void PNMPainter::
96 draw_hline_point(
int x,
float xa,
float ya,
float xd,
float yd,
98 float y = (yd * (x - xa) / xd) + ya;
99 int ymax = (int)cceil(y);
100 int ymin = (int)cfloor(y);
102 _pen->draw(_image, x, ymin, pixel_scale);
104 _pen->draw(_image, x, ymax, (y - ymin) * pixel_scale);
105 _pen->draw(_image, x, ymin, (ymax - y) * pixel_scale);
115 INLINE
void PNMPainter::
116 draw_vline_point(
int y,
float xa,
float ya,
float xd,
float yd,
118 float x = (xd * (y - ya) / yd) + xa;
119 int xmax = (int)cceil(x);
120 int xmin = (int)cfloor(x);
122 _pen->draw(_image, xmin, y, pixel_scale);
124 _pen->draw(_image, xmax, y, (x - xmin) * pixel_scale);
125 _pen->draw(_image, xmin, y, (xmax - x) * pixel_scale);
PNMBrush * get_pen() const
Returns the current pen.
void draw_point(float x, float y)
Draws an antialiased point on the PNMImage, using the current pen.
PNMBrush * get_fill() const
Returns the current fill brush.
void set_fill(PNMBrush *fill)
Specifies a PNMBrush that will be used for filling in the interiors of objects.
void draw_line(float xa, float ya, float xb, float yb)
Draws an antialiased line on the PNMImage, using the current pen.
void set_pen(PNMBrush *pen)
Specifies a PNMBrush that will be used for drawing lines and edges.
This class is used to control the shape and color of the drawing operations performed by a PNMPainter...