16 out.MoveToPoint(in.at(0).x(), in.at(0).y());
17 for (
size_t i = 1; i < in.size(); ++i)
18 out.AddLineToPoint(in[i].x(), in[i].y());
27 auto path = out.CreatePath();
28 out.StrokePath(
add(v, path));
31 auto path = out.CreatePath();
32 add(v.outer(), path).CloseSubpath();
33 for (
auto& item : v.inners())
34 add(item, path).CloseSubpath();
38 std::ranges::for_each(v, self);
46 execution_policy
auto policy,
47 boost::gil::rgba8c_view_t in,
50 wxGraphicsContext& out,
54 auto [fwd, inv] = bidirectional(in_affine, in_crs, out_affine, out_crs);
58 w = std::ceil(w), h = std::ceil(h);
59 auto a = v.min_corner(), b = v.max_corner();
60 auto x = std::floor(a.x()), y = std::floor(a.y());
61 return wxRect2DDouble{0., 0., w, h}.CreateIntersection(
62 {x, y, std::ceil(b.x()) - x, std::ceil(b.y()) - y});
64 auto mbr = fwd(multi_point(in.width(), in.height()))
66 .transform(intersect);
67 if (!mbr || mbr->IsEmpty())
69 auto img = wxImage{mbr->GetSize()};
71 auto ys = std::views::iota(0, img.GetHeight());
72 auto pixel = get_pixel(in);
73 std::for_each(policy, ys.begin(), ys.end(), [&](
int y) {
74 auto d = y * img.GetWidth();
75 auto rgb = reinterpret_cast<wxImage::RGBValue*>(img.GetData()) + d;
76 auto alpha = img.GetAlpha() + d;
77 for (int x{}; x < img.GetWidth(); ++x)
82 wxImage::RGBValue(get_color(*px, boost::gil::red_t()),
83 get_color(*px, boost::gil::green_t()),
84 get_color(*px, boost::gil::blue_t()));
85 alpha[x] = get_color(*px, boost::gil::alpha_t());
88 alpha[x] = wxIMAGE_ALPHA_TRANSPARENT;
91 out.CreateBitmapFromImage(img),
void draw_image(execution_policy auto policy, boost::gil::rgba8c_view_t in, geometry::matrix const &in_affine, geometry::srs_spec auto &&in_crs, QPainter &out, geometry::matrix const &out_affine, geometry::srs_spec auto &&out_crs)
Definition qt.hpp:44