GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Line clipping algorithm. More...
Go to the source code of this file.
Functions | |
int | gp_line_clip (int *px0, int *py0, int *px1, int *py1, int xmax, int ymax) |
Clips a line. | |
Line clipping algorithm.
Definition in file gp_line_clip.h.
int gp_line_clip | ( | int * | px0, |
int * | py0, | ||
int * | px1, | ||
int * | py1, | ||
int | xmax, | ||
int | ymax | ||
) |
Clips a line.
Clips a line so that the start and end points are within (0, xmax) and (0, ymax). This is used by the line drawing algorithms to make sure that the we only draw the part of line within pixmap.
px0 | A starting x coordinate to clip. |
py0 | A starting y cooridinate to clip. |
px1 | An ending x coordinate to clip. |
py1 | An ending y coordinate to clip. |
xmax | A x coordinate upper limit. |
ymax | A y coordinate upper limit. |