@@ -81,21 +81,17 @@ Py_points_in_path(py::array_t<double> points_obj, double r, py::object path_obj,
8181}
8282
8383static py::tuple
84- Py_update_path_extents (py::object path_obj, py::object trans_obj, py::object rect_obj ,
84+ Py_update_path_extents (py::object path_obj, py::object trans_obj, agg::rect_d rect ,
8585 py::array_t <double > minpos, bool ignore)
8686{
8787 mpl::PathIterator path;
8888 agg::trans_affine trans;
89- agg::rect_d rect;
9089 bool changed;
9190
9291 if (!convert_path (path_obj.ptr (), &path)) {
9392 throw py::error_already_set ();
9493 }
9594 convert_trans_affine (trans_obj, trans);
96- if (!convert_rect (rect_obj.ptr (), &rect)) {
97- throw py::error_already_set ();
98- }
9995
10096 if (minpos.ndim () != 1 ) {
10197 throw py::value_error (
@@ -249,19 +245,14 @@ Py_path_in_path(py::object a_obj, py::object atrans_obj,
249245}
250246
251247static py::list
252- Py_clip_path_to_rect (py::object path_obj, py::object rect_obj,
253- bool inside)
248+ Py_clip_path_to_rect (py::object path_obj, agg::rect_d rect, bool inside)
254249{
255250 mpl::PathIterator path;
256- agg::rect_d rect;
257251 std::vector<Polygon> result;
258252
259253 if (!convert_path (path_obj.ptr (), &path)) {
260254 throw py::error_already_set ();
261255 }
262- if (!convert_rect (rect_obj.ptr (), &rect)) {
263- throw py::error_already_set ();
264- }
265256
266257 clip_path_to_rect (path, rect, inside, result);
267258
@@ -305,14 +296,10 @@ Py_affine_transform(py::array_t<double, py::array::c_style | py::array::forcecas
305296}
306297
307298static int
308- Py_count_bboxes_overlapping_bbox (py::object bbox_obj , py::object bboxes_obj)
299+ Py_count_bboxes_overlapping_bbox (agg::rect_d bbox , py::object bboxes_obj)
309300{
310- agg::rect_d bbox;
311301 numpy::array_view<const double , 3 > bboxes;
312302
313- if (!convert_rect (bbox_obj.ptr (), &bbox)) {
314- throw py::error_already_set ();
315- }
316303 if (!convert_bboxes (bboxes_obj.ptr (), &bboxes)) {
317304 throw py::error_already_set ();
318305 }
@@ -382,22 +369,18 @@ Py_convert_path_to_polygons(py::object path_obj, py::object trans_obj,
382369
383370static py::tuple
384371Py_cleanup_path (py::object path_obj, py::object trans_obj, bool remove_nans,
385- py::object clip_rect_obj , py::object snap_mode_obj, double stroke_width,
372+ agg::rect_d clip_rect , py::object snap_mode_obj, double stroke_width,
386373 std::optional<bool > simplify, bool return_curves, py::object sketch_obj)
387374{
388375 mpl::PathIterator path;
389376 agg::trans_affine trans;
390- agg::rect_d clip_rect;
391377 e_snap_mode snap_mode;
392378 SketchParams sketch;
393379
394380 if (!convert_path (path_obj.ptr (), &path)) {
395381 throw py::error_already_set ();
396382 }
397383 convert_trans_affine (trans_obj, trans);
398- if (!convert_rect (clip_rect_obj.ptr (), &clip_rect)) {
399- throw py::error_already_set ();
400- }
401384 if (!convert_snap (snap_mode_obj.ptr (), &snap_mode)) {
402385 throw py::error_already_set ();
403386 }
@@ -460,13 +443,12 @@ postfix : bool
460443)""" ;
461444
462445static py::object
463- Py_convert_to_string (py::object path_obj, py::object trans_obj, py::object cliprect_obj ,
446+ Py_convert_to_string (py::object path_obj, py::object trans_obj, agg::rect_d cliprect ,
464447 std::optional<bool > simplify, py::object sketch_obj, int precision,
465448 std::array<std::string, 5 > codes_obj, bool postfix)
466449{
467450 mpl::PathIterator path;
468451 agg::trans_affine trans;
469- agg::rect_d cliprect;
470452 SketchParams sketch;
471453 char *codes[5 ];
472454 std::string buffer;
@@ -476,9 +458,6 @@ Py_convert_to_string(py::object path_obj, py::object trans_obj, py::object clipr
476458 throw py::error_already_set ();
477459 }
478460 convert_trans_affine (trans_obj, trans);
479- if (!convert_rect (cliprect_obj.ptr (), &cliprect)) {
480- throw py::error_already_set ();
481- }
482461 if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
483462 throw py::error_already_set ();
484463 }
0 commit comments