Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4657204

Browse files
committed
Remove unused functions in _path
1 parent251ae54 commit4657204

File tree

3 files changed

+13
-120
lines changed

3 files changed

+13
-120
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``ft2font.FT2Image.draw_rect`` and ``ft2font.FT2Font.get_xys``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... are deprecated as they are unused. If you rely on these, please let us know.

‎src/_path.h

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -282,35 +282,15 @@ inline bool point_in_path(
282282
return result[0] !=0;
283283
}
284284

285-
template<classPathIterator,classPointArray,classResultArray>
286-
voidpoints_on_path(PointArray &points,
287-
constdouble r,
288-
PathIterator &path,
289-
agg::trans_affine &trans,
290-
ResultArray result)
285+
template<classPathIterator>
286+
inlineboolpoint_on_path(
287+
double x,double y,constdouble r, PathIterator &path, agg::trans_affine &trans)
291288
{
292289
typedef agg::conv_transform<PathIterator>transformed_path_t;
293290
typedef PathNanRemover<transformed_path_t>no_nans_t;
294291
typedef agg::conv_curve<no_nans_t>curve_t;
295292
typedef agg::conv_stroke<curve_t>stroke_t;
296293

297-
size_t i;
298-
for (i =0; i < points.size(); ++i) {
299-
result[i] =false;
300-
}
301-
302-
transformed_path_ttrans_path(path, trans);
303-
no_nans_tnan_removed_path(trans_path,true, path.has_codes());
304-
curve_tcurved_path(nan_removed_path);
305-
stroke_tstroked_path(curved_path);
306-
stroked_path.width(r *2.0);
307-
point_in_path_impl(points, stroked_path, result);
308-
}
309-
310-
template<classPathIterator>
311-
inlineboolpoint_on_path(
312-
double x,double y,constdouble r, PathIterator &path, agg::trans_affine &trans)
313-
{
314294
npy_intp shape[] = {1,2};
315295
numpy::array_view<double,2>points(shape);
316296
points(0,0) = x;
@@ -319,8 +299,12 @@ inline bool point_on_path(
319299
int result[1];
320300
result[0] =0;
321301

322-
points_on_path(points, r, path, trans, result);
323-
302+
transformed_path_ttrans_path(path, trans);
303+
no_nans_tnan_removed_path(trans_path,true, path.has_codes());
304+
curve_tcurved_path(nan_removed_path);
305+
stroke_tstroked_path(curved_path);
306+
stroked_path.width(r *2.0);
307+
point_in_path_impl(points, stroked_path, result);
324308
return result[0] !=0;
325309
}
326310

‎src/_path_wrapper.cpp

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -91,98 +91,6 @@ static PyObject *Py_points_in_path(PyObject *self, PyObject *args)
9191
return results.pyobj();
9292
}
9393

94-
constchar *Py_point_on_path__doc__ =
95-
"point_on_path(x, y, radius, path, trans)\n"
96-
"--\n\n";
97-
98-
static PyObject *Py_point_on_path(PyObject *self, PyObject *args)
99-
{
100-
double x, y, r;
101-
py::PathIterator path;
102-
agg::trans_affine trans;
103-
bool result;
104-
105-
if (!PyArg_ParseTuple(args,
106-
"dddO&O&:point_on_path",
107-
&x,
108-
&y,
109-
&r,
110-
&convert_path,
111-
&path,
112-
&convert_trans_affine,
113-
&trans)) {
114-
returnNULL;
115-
}
116-
117-
CALL_CPP("point_on_path", (result =point_on_path(x, y, r, path, trans)));
118-
119-
if (result) {
120-
Py_RETURN_TRUE;
121-
}else {
122-
Py_RETURN_FALSE;
123-
}
124-
}
125-
126-
constchar *Py_points_on_path__doc__ =
127-
"points_on_path(points, radius, path, trans)\n"
128-
"--\n\n";
129-
130-
static PyObject *Py_points_on_path(PyObject *self, PyObject *args)
131-
{
132-
numpy::array_view<constdouble,2> points;
133-
double r;
134-
py::PathIterator path;
135-
agg::trans_affine trans;
136-
137-
if (!PyArg_ParseTuple(args,
138-
"O&dO&O&:points_on_path",
139-
&convert_points,
140-
&points,
141-
&r,
142-
&convert_path,
143-
&path,
144-
&convert_trans_affine,
145-
&trans)) {
146-
returnNULL;
147-
}
148-
149-
npy_intp dims[] = { (npy_intp)points.size() };
150-
numpy::array_view<uint8_t,1>results(dims);
151-
152-
CALL_CPP("points_on_path", (points_on_path(points, r, path, trans, results)));
153-
154-
return results.pyobj();
155-
}
156-
157-
constchar *Py_get_path_extents__doc__ =
158-
"get_path_extents(path, trans)\n"
159-
"--\n\n";
160-
161-
static PyObject *Py_get_path_extents(PyObject *self, PyObject *args)
162-
{
163-
py::PathIterator path;
164-
agg::trans_affine trans;
165-
166-
if (!PyArg_ParseTuple(
167-
args,"O&O&:get_path_extents", &convert_path, &path, &convert_trans_affine, &trans)) {
168-
returnNULL;
169-
}
170-
171-
extent_limits e;
172-
173-
CALL_CPP("get_path_extents", (reset_limits(e)));
174-
CALL_CPP("get_path_extents", (update_path_extents(path, trans, e)));
175-
176-
npy_intp dims[] = {2,2 };
177-
numpy::array_view<double,2>extents(dims);
178-
extents(0,0) = e.x0;
179-
extents(0,1) = e.y0;
180-
extents(1,0) = e.x1;
181-
extents(1,1) = e.y1;
182-
183-
return extents.pyobj();
184-
}
185-
18694
constchar *Py_update_path_extents__doc__ =
18795
"update_path_extents(path, trans, rect, minpos, ignore)\n"
18896
"--\n\n";
@@ -845,9 +753,6 @@ static PyObject *Py_is_sorted(PyObject *self, PyObject *obj)
845753
static PyMethodDef module_functions[] = {
846754
{"point_in_path", (PyCFunction)Py_point_in_path, METH_VARARGS, Py_point_in_path__doc__},
847755
{"points_in_path", (PyCFunction)Py_points_in_path, METH_VARARGS, Py_points_in_path__doc__},
848-
{"point_on_path", (PyCFunction)Py_point_on_path, METH_VARARGS, Py_point_on_path__doc__},
849-
{"points_on_path", (PyCFunction)Py_points_on_path, METH_VARARGS, Py_points_on_path__doc__},
850-
{"get_path_extents", (PyCFunction)Py_get_path_extents, METH_VARARGS, Py_get_path_extents__doc__},
851756
{"update_path_extents", (PyCFunction)Py_update_path_extents, METH_VARARGS, Py_update_path_extents__doc__},
852757
{"get_path_collection_extents", (PyCFunction)Py_get_path_collection_extents, METH_VARARGS, Py_get_path_collection_extents__doc__},
853758
{"point_in_path_collection", (PyCFunction)Py_point_in_path_collection, METH_VARARGS, Py_point_in_path_collection__doc__},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp