Skip to content
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

Renderer: Add stroke trim API #2190

Closed
hermet opened this issue Apr 16, 2024 · 2 comments
Closed

Renderer: Add stroke trim API #2190

hermet opened this issue Apr 16, 2024 · 2 comments
Assignees
Labels
feature New feature additions
Milestone

Comments

@hermet
Copy link
Member

hermet commented Apr 16, 2024

Stroke trimming is useful for artistic visuals including Lottie Animation.
ThorVG already has this feature built-in; it could provide the APIs for general usage:

Shape::strokeTrim(float begin = 0.0f, float end = 1.0f)
@hermet hermet added the feature New feature additions label Apr 16, 2024
@hermet hermet added this to the 0.14 milestone Apr 16, 2024
@hermet hermet changed the title Renderer: Add stroke trim interface. Renderer: Add stroke trim API Apr 16, 2024
@mgrudzinska mgrudzinska self-assigned this May 30, 2024
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 30, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 30, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 31, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 31, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue May 31, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
@hermet
Copy link
Member Author

hermet commented Jun 1, 2024

see this: #2333

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jun 1, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
@hermet
Copy link
Member Author

hermet commented Jun 3, 2024

Updated version:

Result Shape::strokeTrim(float begin, float end, bool simultaneous = true) noexcept;
bool Shape::strokeTrim(float* begin, float* end) const noexcept;

These API can be considered additionally if the trimming direction is properly introduced.
for example, allow the range -1 ~ +1 rather than 0 ~ 1
or additional parameter such as direction

mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jun 3, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jun 3, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jun 3, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
mgrudzinska added a commit to mgrudzinska/thorvg that referenced this issue Jun 4, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: thorvg#2190
hermet pushed a commit that referenced this issue Jun 5, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: #2190
@hermet hermet closed this as completed Jun 5, 2024
hermet pushed a commit that referenced this issue Jun 7, 2024
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: #2190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature additions
Projects
Status: Done 0.14
Development

No branches or pull requests

2 participants