Can the CImg library draw thick lines

I used the CImg library and was pleased with how easy it is to integrate and use. However, now I want to draw thick lines (i.e., More than one pixel). From the API documentation, the draw_line function draw_line not show ( here ) how this can be done. The second version of the function (just below the first in the documentation) even accepts the texture as input, but again without width. It seems strange that such an extensive library will not have this function. Perhaps this should be done with some kind of transformation? I know that I can do this using a polygon (i.e. a Rectangle, where I would calculate the angles of a polygon using the normal to the line), but I'm afraid it will be much slower.

+4
source share
1 answer

Apparently, this is impossible "out of the box", but your own subroutine is created, which calls the draw_line () CImg procedure several times, and shifts of one or two pixels should give you the result I want, without much difficulty.

+4
source

All Articles