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

Shorten Agg template usage with class template argument deduction.#29763

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
anntzer wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromanntzer:ctad
Open
Show file tree
Hide file tree
Changes fromall 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
29 changes: 13 additions & 16 deletionssrc/_backend_agg.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,15 +122,6 @@ bool RendererAgg::render_clippath(mpl::PathIterator &clippath,
const agg::trans_affine &clippath_trans,
e_snap_mode snap_mode)
{
typedef agg::conv_transform<mpl::PathIterator> transformed_path_t;
typedef PathNanRemover<transformed_path_t> nan_removed_t;
/* Unlike normal Paths, the clip path cannot be clipped to the Figure bbox,
* because it needs to remain a complete closed path, so there is no
* PathClipper<nan_removed_t> step. */
typedef PathSnapper<nan_removed_t> snapped_t;
typedef PathSimplifier<snapped_t> simplify_t;
typedef agg::conv_curve<simplify_t> curve_t;

bool has_clippath = (clippath.total_vertices() != 0);

if (has_clippath &&
Expand All@@ -141,13 +132,19 @@ bool RendererAgg::render_clippath(mpl::PathIterator &clippath,
trans *= agg::trans_affine_translation(0.0, (double)height);

rendererBaseAlphaMask.clear(agg::gray8(0, 0));
transformed_path_t transformed_clippath(clippath, trans);
nan_removed_t nan_removed_clippath(transformed_clippath, true, clippath.has_codes());
snapped_t snapped_clippath(nan_removed_clippath, snap_mode, clippath.total_vertices(), 0.0);
simplify_t simplified_clippath(snapped_clippath,
clippath.should_simplify() && !clippath.has_codes(),
clippath.simplify_threshold());
curve_t curved_clippath(simplified_clippath);
auto transformed_clippath = agg::conv_transform{clippath, trans};
auto nan_removed_clippath = PathNanRemover{
transformed_clippath, true, clippath.has_codes()};
// Unlike normal Paths, the clip path cannot be clipped to the Figure
// bbox, because it needs to remain a complete closed path, so there is
// no PathClipper step after nan-removal.
auto snapped_clippath = PathSnapper{
nan_removed_clippath, snap_mode, clippath.total_vertices(), 0.0};
auto simplified_clippath = PathSimplifier{
snapped_clippath,
clippath.should_simplify() && !clippath.has_codes(),
clippath.simplify_threshold()};
auto curved_clippath = agg::conv_curve{simplified_clippath};
theRasterizer.add_path(curved_clippath);
rendererAlphaMask.color(agg::gray8(255, 255));
agg::render_scanlines(theRasterizer, scanlineAlphaMask, rendererAlphaMask);
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp