C++ 使用CIMG为c++;
我正在努力学习,但同时文档也很模糊。 我正在玩绘图功能,我想画一条线。functoon声明非常简单:C++ 使用CIMG为c++;,c++,cimg,C++,Cimg,我正在努力学习,但同时文档也很模糊。 我正在玩绘图功能,我想画一条线。functoon声明非常简单: CImg<T>& draw_line ( const int x0, const int y0, const int x1, const int y1, const tc *const color, const float opacity = 1,
CImg<T>& draw_line ( const int x0,
const int y0,
const int x1,
const int y1,
const tc *const color,
const float opacity = 1,
const unsigned int pattern = ~0U,
const bool init_hatch = true
)
我的问题是关于模式,我在文档中找不到哪个整数代表哪种类型的线。现在有人知道如何操纵这个模式了吗
提前谢谢你一位开发者通过电子邮件向我回复了这个问题,我在这里为有同样问题的人发布了这个问题 模式由无符号int中的位的设置方式给出。 您必须将无符号整数视为32像素的模式(即。 32位),可以是透明的(位设置为0)或不透明的(位设置为 至1)。 例如,所有位都设置为1的模式是完全不透明的,并且 对应于模式值0xFFFFFF。 一种模式,其中8个像素是透明的,然后8个像素是不透明的 对应于模式0xFF00FF00。 类似0xCCCC的图案表示1像素透明,然后1像素不透明, 等等
x0 X-coordinate of the starting line point.
y0 Y-coordinate of the starting line point.
x1 X-coordinate of the ending line point.
y1 Y-coordinate of the ending line point.
color Pointer to spectrum() consecutive values of type T, defining the drawing color.
opacity Drawing opacity.
**pattern An integer whose bits describe the line pattern.**
init_hatch Tells if a reinitialization of the hash state must be done.