@@ -87,21 +87,17 @@ Py_points_in_path(py::array_t<double> points_obj, double r, py::object path_obj,
87
87
}
88
88
89
89
static py::tuple
90
- Py_update_path_extents (py::object path_obj, py::object trans_obj, py::object rect_obj ,
90
+ Py_update_path_extents (py::object path_obj, py::object trans_obj, agg::rect_d rect ,
91
91
py::array_t <double > minpos, bool ignore)
92
92
{
93
93
mpl::PathIterator path;
94
94
agg::trans_affine trans;
95
- agg::rect_d rect;
96
95
bool changed;
97
96
98
97
if (!convert_path (path_obj.ptr (), &path)) {
99
98
throw py::error_already_set ();
100
99
}
101
100
convert_trans_affine (trans_obj, trans);
102
- if (!convert_rect (rect_obj.ptr (), &rect)) {
103
- throw py::error_already_set ();
104
- }
105
101
106
102
if (minpos.ndim () != 1 ) {
107
103
throw py::value_error (
@@ -255,19 +251,14 @@ Py_path_in_path(py::object a_obj, py::object atrans_obj,
255
251
}
256
252
257
253
static py::object
258
- Py_clip_path_to_rect (py::object path_obj, py::object rect_obj,
259
- bool inside)
254
+ Py_clip_path_to_rect (py::object path_obj, agg::rect_d rect, bool inside)
260
255
{
261
256
mpl::PathIterator path;
262
- agg::rect_d rect;
263
257
std::vector<Polygon> result;
264
258
265
259
if (!convert_path (path_obj.ptr (), &path)) {
266
260
throw py::error_already_set ();
267
261
}
268
- if (!convert_rect (rect_obj.ptr (), &rect)) {
269
- throw py::error_already_set ();
270
- }
271
262
272
263
clip_path_to_rect (path, rect, inside, result);
273
264
@@ -311,14 +302,10 @@ Py_affine_transform(py::array_t<double, py::array::c_style | py::array::forcecas
311
302
}
312
303
313
304
static int
314
- Py_count_bboxes_overlapping_bbox (py::object bbox_obj , py::object bboxes_obj)
305
+ Py_count_bboxes_overlapping_bbox (agg::rect_d bbox , py::object bboxes_obj)
315
306
{
316
- agg::rect_d bbox;
317
307
numpy::array_view<const double , 3 > bboxes;
318
308
319
- if (!convert_rect (bbox_obj.ptr (), &bbox)) {
320
- throw py::error_already_set ();
321
- }
322
309
if (!convert_bboxes (bboxes_obj.ptr (), &bboxes)) {
323
310
throw py::error_already_set ();
324
311
}
@@ -386,24 +373,20 @@ Py_convert_path_to_polygons(py::object path_obj, py::object trans_obj,
386
373
return convert_polygon_vector (result);
387
374
}
388
375
389
- static py ::tuple
376
+ static pybind11 ::tuple
390
377
Py_cleanup_path (py::object path_obj, py::object trans_obj, bool remove_nans,
391
- py::object clip_rect_obj , py::object snap_mode_obj, double stroke_width,
378
+ agg::rect_d clip_rect , py::object snap_mode_obj, double stroke_width,
392
379
std::optional<bool > simplify, bool return_curves, py::object sketch_obj)
393
380
{
394
381
mpl::PathIterator path;
395
382
agg::trans_affine trans;
396
- agg::rect_d clip_rect;
397
383
e_snap_mode snap_mode;
398
384
SketchParams sketch;
399
385
400
386
if (!convert_path (path_obj.ptr (), &path)) {
401
387
throw py::error_already_set ();
402
388
}
403
389
convert_trans_affine (trans_obj, trans);
404
- if (!convert_rect (clip_rect_obj.ptr (), &clip_rect)) {
405
- throw py::error_already_set ();
406
- }
407
390
if (!convert_snap (snap_mode_obj.ptr (), &snap_mode)) {
408
391
throw py::error_already_set ();
409
392
}
@@ -466,13 +449,12 @@ postfix : bool
466
449
)""" ;
467
450
468
451
static py::object
469
- Py_convert_to_string (py::object path_obj, py::object trans_obj, py::object cliprect_obj ,
452
+ Py_convert_to_string (py::object path_obj, py::object trans_obj, agg::rect_d cliprect ,
470
453
std::optional<bool > simplify, py::object sketch_obj, int precision,
471
454
std::array<std::string, 5 > codes_obj, bool postfix)
472
455
{
473
456
mpl::PathIterator path;
474
457
agg::trans_affine trans;
475
- agg::rect_d cliprect;
476
458
SketchParams sketch;
477
459
char *codes[5 ];
478
460
std::string buffer;
@@ -482,9 +464,6 @@ Py_convert_to_string(py::object path_obj, py::object trans_obj, py::object clipr
482
464
throw py::error_already_set ();
483
465
}
484
466
convert_trans_affine (trans_obj, trans);
485
- if (!convert_rect (cliprect_obj.ptr (), &cliprect)) {
486
- throw py::error_already_set ();
487
- }
488
467
if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
489
468
throw py::error_already_set ();
490
469
}
0 commit comments