是的,您可以使用Magick::Image.distort
. 尽管由于您对 POV 项目有非常本地化的要求,因此会出现一些试验和错误。
沿圆圈重复图像
ArcDistortion示例同样适用于Magick++
. 确保启用虚拟像素方法,并使用 360 度圆弧扭曲给定图像。我正在使用图像“pattern:CHECKERBOARD”,但您会使用“tile:image_source.png”。
Magick::Image MyArc;
MyArc.read("pattern:CHECKERBOARD");
MyArc.size("600x45");
MyArc.virtualPixelMethod(Magick::WhiteVirtualPixelMethod);
const double arcArgs[1] = {360};
MyArc.distort(Magick::ArcDistortion,1, arcArgs,Magick::MagickTrue);
MyArc.write("out.png");
这将为您提供沿圆圈重复的图像。

保护者内圈
控制内外圆的大小。将第三和第四个参数应用于失真方法。
const double arcArgs[4] = {360,0,200,100};
MyArc.distort(Magick::ArcDistortion,4, arcArgs,Magick::MagickTrue);

带有预处理的自定义图像
至于添加空白、填充、出血和调整图像重复。这些都需要在电弧变形之前进行预处理。
Magick::Image SourceImage;
SourceImage.read("me.png");
SourceImage.resize("45x45");
// Add whitespace between repeating image
SourceImage.extent(Magick::Geometry(100,45));
// Resize image to be "long" enough to bend around arc.
SourceImage.size("600x45");
// PrePrecess image to tile horizontally with Edge Virtual Pixel
SourceImage.virtualPixelMethod(Magick::HorizontalTileEdgeVirtualPixelMethod);
const double tileArgs[1] = {0};
SourceImage.distort(Magick::ScaleRotateTranslateDistortion,1,tileArgs,Magick::MagickTrue);
// Distort around circle
SourceImage.virtualPixelMethod(Magick::WhiteVirtualPixelMethod);
const double arcArgs[4] = {360,0,200,100};
SourceImage.distort(Magick::ArcDistortion,4, arcArgs,Magick::MagickTrue);
SourceImage.write("out.png");

如果 POV 问题可以通过有趣的数学来解决,请记住很多。