@@ -40,17 +40,11 @@ PyBufferRegion_get_extents(BufferRegion *self)
40
40
41
41
static void
42
42
PyRendererAgg_draw_path (RendererAgg *self,
43
- pybind11::object gc_obj ,
43
+ GCAgg &gc ,
44
44
mpl::PathIterator path,
45
45
agg::trans_affine trans,
46
46
agg::rgba face)
47
47
{
48
- GCAgg gc;
49
-
50
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
51
- throw pybind11::error_already_set ();
52
- }
53
-
54
48
self->draw_path (gc, path, trans, face);
55
49
}
56
50
@@ -60,52 +54,38 @@ PyRendererAgg_draw_text_image(RendererAgg *self,
60
54
double x,
61
55
double y,
62
56
double angle,
63
- pybind11::object gc_obj )
57
+ GCAgg &gc )
64
58
{
65
59
numpy::array_view<agg::int8u, 2 > image;
66
- GCAgg gc;
67
60
68
61
if (!image.converter_contiguous (image_obj.ptr (), &image)) {
69
62
throw pybind11::error_already_set ();
70
63
}
71
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
72
- throw pybind11::error_already_set ();
73
- }
74
64
75
65
self->draw_text_image (gc, image, x, y, angle);
76
66
}
77
67
78
68
static void
79
69
PyRendererAgg_draw_markers (RendererAgg *self,
80
- pybind11::object gc_obj ,
70
+ GCAgg &gc ,
81
71
mpl::PathIterator marker_path,
82
72
agg::trans_affine marker_path_trans,
83
73
mpl::PathIterator path,
84
74
agg::trans_affine trans,
85
75
agg::rgba face)
86
76
{
87
- GCAgg gc;
88
-
89
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
90
- throw pybind11::error_already_set ();
91
- }
92
-
93
77
self->draw_markers (gc, marker_path, marker_path_trans, path, trans, face);
94
78
}
95
79
96
80
static void
97
81
PyRendererAgg_draw_image (RendererAgg *self,
98
- pybind11::object gc_obj ,
82
+ GCAgg &gc ,
99
83
double x,
100
84
double y,
101
85
pybind11::array_t <agg::int8u, pybind11::array::c_style> image_obj)
102
86
{
103
- GCAgg gc;
104
87
numpy::array_view<agg::int8u, 3 > image;
105
88
106
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
107
- throw pybind11::error_already_set ();
108
- }
109
89
if (!image.set (image_obj.ptr ())) {
110
90
throw pybind11::error_already_set ();
111
91
}
@@ -119,7 +99,7 @@ PyRendererAgg_draw_image(RendererAgg *self,
119
99
120
100
static void
121
101
PyRendererAgg_draw_path_collection (RendererAgg *self,
122
- pybind11::object gc_obj ,
102
+ GCAgg &gc ,
123
103
agg::trans_affine master_transform,
124
104
pybind11::object paths_obj,
125
105
pybind11::object transforms_obj,
@@ -128,25 +108,20 @@ PyRendererAgg_draw_path_collection(RendererAgg *self,
128
108
pybind11::object facecolors_obj,
129
109
pybind11::object edgecolors_obj,
130
110
pybind11::object linewidths_obj,
131
- pybind11::object dashes_obj ,
111
+ DashesVector dashes ,
132
112
pybind11::object antialiaseds_obj,
133
113
pybind11::object Py_UNUSED (ignored_obj),
134
114
// offset position is no longer used
135
115
pybind11::object Py_UNUSED(offset_position_obj))
136
116
{
137
- GCAgg gc;
138
117
mpl::PathGenerator paths;
139
118
numpy::array_view<const double , 3 > transforms;
140
119
numpy::array_view<const double , 2 > offsets;
141
120
numpy::array_view<const double , 2 > facecolors;
142
121
numpy::array_view<const double , 2 > edgecolors;
143
122
numpy::array_view<const double , 1 > linewidths;
144
- DashesVector dashes;
145
123
numpy::array_view<const uint8_t , 1 > antialiaseds;
146
124
147
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
148
- throw pybind11::error_already_set ();
149
- }
150
125
if (!convert_pathgen (paths_obj.ptr (), &paths)) {
151
126
throw pybind11::error_already_set ();
152
127
}
@@ -165,9 +140,6 @@ PyRendererAgg_draw_path_collection(RendererAgg *self,
165
140
if (!linewidths.converter (linewidths_obj.ptr (), &linewidths)) {
166
141
throw pybind11::error_already_set ();
167
142
}
168
- if (!convert_dashes_vector (dashes_obj.ptr (), &dashes)) {
169
- throw pybind11::error_already_set ();
170
- }
171
143
if (!antialiaseds.converter (antialiaseds_obj.ptr (), &antialiaseds)) {
172
144
throw pybind11::error_already_set ();
173
145
}
@@ -187,7 +159,7 @@ PyRendererAgg_draw_path_collection(RendererAgg *self,
187
159
188
160
static void
189
161
PyRendererAgg_draw_quad_mesh (RendererAgg *self,
190
- pybind11::object gc_obj ,
162
+ GCAgg &gc ,
191
163
agg::trans_affine master_transform,
192
164
unsigned int mesh_width,
193
165
unsigned int mesh_height,
@@ -198,15 +170,11 @@ PyRendererAgg_draw_quad_mesh(RendererAgg *self,
198
170
bool antialiased,
199
171
pybind11::object edgecolors_obj)
200
172
{
201
- GCAgg gc;
202
173
numpy::array_view<const double , 3 > coordinates;
203
174
numpy::array_view<const double , 2 > offsets;
204
175
numpy::array_view<const double , 2 > facecolors;
205
176
numpy::array_view<const double , 2 > edgecolors;
206
177
207
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
208
- throw pybind11::error_already_set ();
209
- }
210
178
if (!coordinates.converter (coordinates_obj.ptr (), &coordinates)) {
211
179
throw pybind11::error_already_set ();
212
180
}
@@ -234,18 +202,14 @@ PyRendererAgg_draw_quad_mesh(RendererAgg *self,
234
202
235
203
static void
236
204
PyRendererAgg_draw_gouraud_triangles (RendererAgg *self,
237
- pybind11::object gc_obj ,
205
+ GCAgg &gc ,
238
206
pybind11::object points_obj,
239
207
pybind11::object colors_obj,
240
208
agg::trans_affine trans)
241
209
{
242
- GCAgg gc;
243
210
numpy::array_view<const double , 3 > points;
244
211
numpy::array_view<const double , 3 > colors;
245
212
246
- if (!convert_gcagg (gc_obj.ptr (), &gc)) {
247
- throw pybind11::error_already_set ();
248
- }
249
213
if (!points.converter (points_obj.ptr (), &points)) {
250
214
throw pybind11::error_already_set ();
251
215
}
0 commit comments