@@ -77,21 +77,17 @@ Py_points_in_path(py::array_t<double> points_obj, double r, py::object path_obj,
7777}
7878
7979static py::tuple
80- Py_update_path_extents (py::object path_obj, py::object trans_obj, py::object rect_obj ,
80+ Py_update_path_extents (py::object path_obj, py::object trans_obj, agg::rect_d rect ,
8181 py::array_t <double > minpos, bool ignore)
8282{
8383 mpl::PathIterator path;
8484 agg::trans_affine trans;
85- agg::rect_d rect;
8685 bool changed;
8786
8887 if (!convert_path (path_obj.ptr (), &path)) {
8988 throw py::error_already_set ();
9089 }
9190 convert_trans_affine (trans_obj, trans);
92- if (!convert_rect (rect_obj.ptr (), &rect)) {
93- throw py::error_already_set ();
94- }
9591
9692 if (minpos.ndim () != 1 ) {
9793 throw py::value_error (
@@ -241,19 +237,14 @@ Py_path_in_path(py::object a_obj, py::object atrans_obj,
241237}
242238
243239static py::list
244- Py_clip_path_to_rect (py::object path_obj, py::object rect_obj,
245- bool inside)
240+ Py_clip_path_to_rect (py::object path_obj, agg::rect_d rect, bool inside)
246241{
247242 mpl::PathIterator path;
248- agg::rect_d rect;
249243 std::vector<Polygon> result;
250244
251245 if (!convert_path (path_obj.ptr (), &path)) {
252246 throw py::error_already_set ();
253247 }
254- if (!convert_rect (rect_obj.ptr (), &rect)) {
255- throw py::error_already_set ();
256- }
257248
258249 clip_path_to_rect (path, rect, inside, result);
259250
@@ -297,14 +288,10 @@ Py_affine_transform(py::array_t<double, py::array::c_style | py::array::forcecas
297288}
298289
299290static int
300- Py_count_bboxes_overlapping_bbox (py::object bbox_obj , py::object bboxes_obj)
291+ Py_count_bboxes_overlapping_bbox (agg::rect_d bbox , py::object bboxes_obj)
301292{
302- agg::rect_d bbox;
303293 numpy::array_view<const double , 3 > bboxes;
304294
305- if (!convert_rect (bbox_obj.ptr (), &bbox)) {
306- throw py::error_already_set ();
307- }
308295 if (!convert_bboxes (bboxes_obj.ptr (), &bboxes)) {
309296 throw py::error_already_set ();
310297 }
@@ -374,22 +361,18 @@ Py_convert_path_to_polygons(py::object path_obj, py::object trans_obj,
374361
375362static py::tuple
376363Py_cleanup_path (py::object path_obj, py::object trans_obj, bool remove_nans,
377- py::object clip_rect_obj , py::object snap_mode_obj, double stroke_width,
364+ agg::rect_d clip_rect , py::object snap_mode_obj, double stroke_width,
378365 std::optional<bool > simplify, bool return_curves, py::object sketch_obj)
379366{
380367 mpl::PathIterator path;
381368 agg::trans_affine trans;
382- agg::rect_d clip_rect;
383369 e_snap_mode snap_mode;
384370 SketchParams sketch;
385371
386372 if (!convert_path (path_obj.ptr (), &path)) {
387373 throw py::error_already_set ();
388374 }
389375 convert_trans_affine (trans_obj, trans);
390- if (!convert_rect (clip_rect_obj.ptr (), &clip_rect)) {
391- throw py::error_already_set ();
392- }
393376 if (!convert_snap (snap_mode_obj.ptr (), &snap_mode)) {
394377 throw py::error_already_set ();
395378 }
@@ -449,13 +432,12 @@ postfix : bool
449432)""" ;
450433
451434static py::object
452- Py_convert_to_string (py::object path_obj, py::object trans_obj, py::object cliprect_obj ,
435+ Py_convert_to_string (py::object path_obj, py::object trans_obj, agg::rect_d cliprect ,
453436 std::optional<bool > simplify, py::object sketch_obj, int precision,
454437 std::array<std::string, 5 > codes_obj, bool postfix)
455438{
456439 mpl::PathIterator path;
457440 agg::trans_affine trans;
458- agg::rect_d cliprect;
459441 SketchParams sketch;
460442 char *codes[5 ];
461443 std::string buffer;
@@ -465,9 +447,6 @@ Py_convert_to_string(py::object path_obj, py::object trans_obj, py::object clipr
465447 throw py::error_already_set ();
466448 }
467449 convert_trans_affine (trans_obj, trans);
468- if (!convert_rect (cliprect_obj.ptr (), &cliprect)) {
469- throw py::error_already_set ();
470- }
471450 if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
472451 throw py::error_already_set ();
473452 }
0 commit comments