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

Appearance settings

Improve docs of _path C-extension. #19322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 83 additions & 23 deletions 106 src/_path_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ PyObject *convert_polygon_vector(std::vector<Polygon> &polygons)
return pyresult;
}

const char *Py_point_in_path__doc__ = "point_in_path(x, y, radius, path, trans)";
const char *Py_point_in_path__doc__ =
"point_in_path(x, y, radius, path, trans)\n"
"--\n\n";

static PyObject *Py_point_in_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -58,7 +60,9 @@ static PyObject *Py_point_in_path(PyObject *self, PyObject *args, PyObject *kwds
}
}

const char *Py_points_in_path__doc__ = "points_in_path(points, radius, path, trans)";
const char *Py_points_in_path__doc__ =
"points_in_path(points, radius, path, trans)\n"
"--\n\n";

static PyObject *Py_points_in_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -87,7 +91,9 @@ static PyObject *Py_points_in_path(PyObject *self, PyObject *args, PyObject *kwd
return results.pyobj();
}

const char *Py_point_on_path__doc__ = "point_on_path(x, y, radius, path, trans)";
const char *Py_point_on_path__doc__ =
"point_on_path(x, y, radius, path, trans)\n"
"--\n\n";

static PyObject *Py_point_on_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -117,7 +123,9 @@ static PyObject *Py_point_on_path(PyObject *self, PyObject *args, PyObject *kwds
}
}

const char *Py_points_on_path__doc__ = "points_on_path(points, radius, path, trans)";
const char *Py_points_on_path__doc__ =
"points_on_path(points, radius, path, trans)\n"
"--\n\n";

static PyObject *Py_points_on_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -146,7 +154,9 @@ static PyObject *Py_points_on_path(PyObject *self, PyObject *args, PyObject *kwd
return results.pyobj();
}

const char *Py_get_path_extents__doc__ = "get_path_extents(path, trans)";
const char *Py_get_path_extents__doc__ =
"get_path_extents(path, trans)\n"
"--\n\n";

static PyObject *Py_get_path_extents(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -174,7 +184,8 @@ static PyObject *Py_get_path_extents(PyObject *self, PyObject *args, PyObject *k
}

const char *Py_update_path_extents__doc__ =
"update_path_extents(path, trans, rect, minpos, ignore)";
"update_path_extents(path, trans, rect, minpos, ignore)\n"
"--\n\n";

static PyObject *Py_update_path_extents(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -250,8 +261,10 @@ static PyObject *Py_update_path_extents(PyObject *self, PyObject *args, PyObject
"NNi", outextents.pyobj(), outminpos.pyobj(), changed);
}

const char *Py_get_path_collection_extents__doc__ = "get_path_collection_extents("
"master_transform, paths, transforms, offsets, offset_transform)";
const char *Py_get_path_collection_extents__doc__ =
"get_path_collection_extents("
"master_transform, paths, transforms, offsets, offset_transform)\n"
"--\n\n";

static PyObject *Py_get_path_collection_extents(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -305,8 +318,10 @@ static PyObject *Py_get_path_collection_extents(PyObject *self, PyObject *args,
}

const char *Py_point_in_path_collection__doc__ =
"point_in_path_collection(x, y, radius, master_transform, paths, transforms, offsets, "
"offset_trans, filled, offset_position)";
"point_in_path_collection("
"x, y, radius, master_transform, paths, transforms, offsets, "
"offset_trans, filled, offset_position)\n"
"--\n\n";

static PyObject *Py_point_in_path_collection(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -371,7 +386,9 @@ static PyObject *Py_point_in_path_collection(PyObject *self, PyObject *args, PyO
return pyresult.pyobj();
}

const char *Py_path_in_path__doc__ = "path_in_path(path_a, trans_a, path_b, trans_b)";
const char *Py_path_in_path__doc__ =
"path_in_path(path_a, trans_a, path_b, trans_b)\n"
"--\n\n";

static PyObject *Py_path_in_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -403,7 +420,9 @@ static PyObject *Py_path_in_path(PyObject *self, PyObject *args, PyObject *kwds)
}
}

const char *Py_clip_path_to_rect__doc__ = "clip_path_to_rect(path, rect, inside)";
const char *Py_clip_path_to_rect__doc__ =
"clip_path_to_rect(path, rect, inside)\n"
"--\n\n";

static PyObject *Py_clip_path_to_rect(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand All @@ -428,7 +447,9 @@ static PyObject *Py_clip_path_to_rect(PyObject *self, PyObject *args, PyObject *
return convert_polygon_vector(result);
}

const char *Py_affine_transform__doc__ = "affine_transform(points, trans)";
const char *Py_affine_transform__doc__ =
"affine_transform(points, trans)\n"
"--\n\n";

static PyObject *Py_affine_transform(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -465,7 +486,9 @@ static PyObject *Py_affine_transform(PyObject *self, PyObject *args, PyObject *k
}
}

const char *Py_count_bboxes_overlapping_bbox__doc__ = "count_bboxes_overlapping_bbox(bbox, bboxes)";
const char *Py_count_bboxes_overlapping_bbox__doc__ =
"count_bboxes_overlapping_bbox(bbox, bboxes)\n"
"--\n\n";

static PyObject *Py_count_bboxes_overlapping_bbox(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand All @@ -488,7 +511,9 @@ static PyObject *Py_count_bboxes_overlapping_bbox(PyObject *self, PyObject *args
return PyLong_FromLong(result);
}

const char *Py_path_intersects_path__doc__ = "path_intersects_path(path1, path2, filled=False)";
const char *Py_path_intersects_path__doc__ =
"path_intersects_path(path1, path2, filled=False)\n"
"--\n\n";

static PyObject *Py_path_intersects_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -531,7 +556,10 @@ static PyObject *Py_path_intersects_path(PyObject *self, PyObject *args, PyObjec
}
}

const char *Py_path_intersects_rectangle__doc__ = "path_intersects_rectangle(path, rect_x1, rect_y1, rect_x2, rect_y2, filled=False)";
const char *Py_path_intersects_rectangle__doc__ =
"path_intersects_rectangle("
"path, rect_x1, rect_y1, rect_x2, rect_y2, filled=False)\n"
"--\n\n";

static PyObject *Py_path_intersects_rectangle(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -566,7 +594,8 @@ static PyObject *Py_path_intersects_rectangle(PyObject *self, PyObject *args, Py
}

const char *Py_convert_path_to_polygons__doc__ =
"convert_path_to_polygons(path, trans, width=0, height=0)";
"convert_path_to_polygons(path, trans, width=0, height=0)\n"
"--\n\n";

static PyObject *Py_convert_path_to_polygons(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -598,8 +627,10 @@ static PyObject *Py_convert_path_to_polygons(PyObject *self, PyObject *args, PyO
}

const char *Py_cleanup_path__doc__ =
"cleanup_path(path, trans, remove_nans, clip_rect, snap_mode, stroke_width, simplify, "
"return_curves, sketch)";
"cleanup_path("
"path, trans, remove_nans, clip_rect, snap_mode, stroke_width, simplify, "
"return_curves, sketch)\n"
"--\n\n";

static PyObject *Py_cleanup_path(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -678,8 +709,35 @@ static PyObject *Py_cleanup_path(PyObject *self, PyObject *args, PyObject *kwds)
return Py_BuildValue("NN", pyvertices.pyobj(), pycodes.pyobj());
}

const char *Py_convert_to_string__doc__ = "convert_to_string(path, trans, "
"clip_rect, simplify, sketch, precision, codes, postfix)";
const char *Py_convert_to_string__doc__ =
"convert_to_string("
"path, trans, clip_rect, simplify, sketch, precision, codes, postfix)\n"
"--\n\n"
"Convert *path* to a bytestring.\n"
"\n"
"The first five parameters (up to *sketch*) are interpreted as in \n"
"`.cleanup_path`. The following ones are detailed below.\n"
"\n"
"Parameters\n"
"----------\n"
"path : Path\n"
"trans : Transform or None\n"
"clip_rect : sequence of 4 floats, or None\n"
"simplify : bool\n"
"sketch : tuple of 3 floats, or None\n"
"precision : int\n"
" The precision used to \"%.*f\"-format the values. Trailing zeros\n"
" and decimal points are always removed. (precision=-1 is a special \n"
" case used to implement ttconv-back-compatible conversion.)\n"
"codes : sequence of 5 bytestrings\n"
" The bytes representation of each opcode (MOVETO, LINETO, CURVE3,\n"
" CURVE4, CLOSEPOLY), in that order. If the bytes for CURVE3 is\n"
" empty, quad segments are automatically converted to cubic ones\n"
" (this is used by backends such as pdf and ps, which do not support\n"
" quads).\n"
"postfix : bool\n"
" Whether the opcode comes after the values (True) or before (False).\n"
;

static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *kwds)
{
Expand Down Expand Up @@ -741,8 +799,10 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *
}


const char *Py_is_sorted__doc__ = "is_sorted(array)\n\n"
"Returns True if 1-D array is monotonically increasing, ignoring NaNs\n";
const char *Py_is_sorted__doc__ =
"is_sorted(array)\n"
"--\n\n"
"Return whether the 1D *array* is monotonically increasing, ignoring NaNs.\n";

static PyObject *Py_is_sorted(PyObject *self, PyObject *obj)
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.