@@ -77,21 +77,17 @@ Py_points_in_path(py::array_t<double> points_obj, double r, py::object path_obj,
77
77
}
78
78
79
79
static 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 ,
81
81
py::array_t <double > minpos, bool ignore)
82
82
{
83
83
mpl::PathIterator path;
84
84
agg::trans_affine trans;
85
- agg::rect_d rect;
86
85
bool changed;
87
86
88
87
if (!convert_path (path_obj.ptr (), &path)) {
89
88
throw py::error_already_set ();
90
89
}
91
90
convert_trans_affine (trans_obj, trans);
92
- if (!convert_rect (rect_obj.ptr (), &rect)) {
93
- throw py::error_already_set ();
94
- }
95
91
96
92
if (minpos.ndim () != 1 ) {
97
93
throw py::value_error (
@@ -241,19 +237,14 @@ Py_path_in_path(py::object a_obj, py::object atrans_obj,
241
237
}
242
238
243
239
static 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)
246
241
{
247
242
mpl::PathIterator path;
248
- agg::rect_d rect;
249
243
std::vector<Polygon> result;
250
244
251
245
if (!convert_path (path_obj.ptr (), &path)) {
252
246
throw py::error_already_set ();
253
247
}
254
- if (!convert_rect (rect_obj.ptr (), &rect)) {
255
- throw py::error_already_set ();
256
- }
257
248
258
249
clip_path_to_rect (path, rect, inside, result);
259
250
@@ -297,14 +288,10 @@ Py_affine_transform(py::array_t<double, py::array::c_style | py::array::forcecas
297
288
}
298
289
299
290
static 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)
301
292
{
302
- agg::rect_d bbox;
303
293
numpy::array_view<const double , 3 > bboxes;
304
294
305
- if (!convert_rect (bbox_obj.ptr (), &bbox)) {
306
- throw py::error_already_set ();
307
- }
308
295
if (!convert_bboxes (bboxes_obj.ptr (), &bboxes)) {
309
296
throw py::error_already_set ();
310
297
}
@@ -374,22 +361,18 @@ Py_convert_path_to_polygons(py::object path_obj, py::object trans_obj,
374
361
375
362
static py::tuple
376
363
Py_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,
378
365
std::optional<bool > simplify, bool return_curves, py::object sketch_obj)
379
366
{
380
367
mpl::PathIterator path;
381
368
agg::trans_affine trans;
382
- agg::rect_d clip_rect;
383
369
e_snap_mode snap_mode;
384
370
SketchParams sketch;
385
371
386
372
if (!convert_path (path_obj.ptr (), &path)) {
387
373
throw py::error_already_set ();
388
374
}
389
375
convert_trans_affine (trans_obj, trans);
390
- if (!convert_rect (clip_rect_obj.ptr (), &clip_rect)) {
391
- throw py::error_already_set ();
392
- }
393
376
if (!convert_snap (snap_mode_obj.ptr (), &snap_mode)) {
394
377
throw py::error_already_set ();
395
378
}
@@ -449,13 +432,12 @@ postfix : bool
449
432
)""" ;
450
433
451
434
static 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 ,
453
436
std::optional<bool > simplify, py::object sketch_obj, int precision,
454
437
std::array<std::string, 5 > codes_obj, bool postfix)
455
438
{
456
439
mpl::PathIterator path;
457
440
agg::trans_affine trans;
458
- agg::rect_d cliprect;
459
441
SketchParams sketch;
460
442
char *codes[5 ];
461
443
std::string buffer;
@@ -465,9 +447,6 @@ Py_convert_to_string(py::object path_obj, py::object trans_obj, py::object clipr
465
447
throw py::error_already_set ();
466
448
}
467
449
convert_trans_affine (trans_obj, trans);
468
- if (!convert_rect (cliprect_obj.ptr (), &cliprect)) {
469
- throw py::error_already_set ();
470
- }
471
450
if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
472
451
throw py::error_already_set ();
473
452
}
0 commit comments