Introduction - If you have any usage issues, please Google them yourself
A straight line and triangle rasterization algorithm: First, the experimental principle
(1) line rasterization: the midpoint algorithm
(2) triangle rasterization: Incremental algorithm: find three vertices of the bounding rectangle, only the candidate pixels within the rectangular loop. Computing center of gravity coordinates, determine the straight line.