77 INLINE
void PNMPainter::
78 draw_hline_point(
int x,
float xa,
float ya,
float xd,
float yd,
80 float y = (yd * (x - xa) / xd) + ya;
81 int ymax = (int)cceil(y);
82 int ymin = (int)cfloor(y);
84 _pen->draw(_image, x, ymin, pixel_scale);
86 _pen->draw(_image, x, ymax, (y - ymin) * pixel_scale);
87 _pen->draw(_image, x, ymin, (ymax - y) * pixel_scale);
94 INLINE
void PNMPainter::
95 draw_vline_point(
int y,
float xa,
float ya,
float xd,
float yd,
97 float x = (xd * (y - ya) / yd) + xa;
98 int xmax = (int)cceil(x);
99 int xmin = (int)cfloor(x);
101 _pen->draw(_image, xmin, y, pixel_scale);
103 _pen->draw(_image, xmax, y, (x - xmin) * pixel_scale);
104 _pen->draw(_image, xmin, y, (xmax - x) * pixel_scale);
This class is used to control the shape and color of the drawing operations performed by a PNMPainter...
get_pen
Returns the current pen.
set_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.
get_fill
Returns the current fill brush.
void draw_point(float x, float y)
Draws an antialiased point on the PNMImage, using the current pen.
set_pen
Specifies a PNMBrush that will be used for drawing lines and edges.