BoostライブラリのGILを使ってC++で新しく作成した画像内に画像を配置する方法を解明しようとしています。あなたはちょうどそれらをコピーするためにあなたのイメージとcopy_pixels
を配置するsubimage_view
を使用することができますC++のBoostのGILを使って画像内に画像を配置する
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/png_dynamic_io.hpp>
using namespace boost::gil;
int main()
{
rgb8_image_t img(512, 512);
rgb8_image_t img1;
rgb8_image_t img2;
png_read_image("img1.png", img1);//Code for loading an image
png_read_image("img2.png", img2); //Code for loading 2nd image "img2.png"
//loading position of the images to an array or some kind of variable
//passing in images and postions to the function to apply changes on newly created image with the size of 512, 512
png_write_view("output.png", const_view(img)); //saving changes as "output.png"
}