-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactoring/Improvements based on Community Feedback to Pipeline Brushes #3304
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
michael-hawker
merged 30 commits into
CommunityToolkit:master
from
Sergio0694:refactoring/more-win2d-tweaks
May 29, 2020
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
afa5047
Merge pull request #10 from windows-toolkit/master
Sergio0694 e8cd4f7
Merge pull request #18 from windows-toolkit/master
Sergio0694 cbc80ef
Merge pull request #19 from windows-toolkit/master
Sergio0694 4079a75
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 f0b5bf0
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 6129c69
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 fdaa307
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 db41e0d
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 6bb8323
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 b5029a7
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 8de5d11
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 95d1575
Merge remote-tracking branch 'upstream/master' into master2
Sergio0694 6bf4a7f
Added missing ContentProperty to BlendEffect
Sergio0694 c2e803f
Removed unnecessary placement parameter for cross fade
Sergio0694 b0a10e3
Added CrossFadeEffect type
Sergio0694 bfe9847
Updated ShadeEffect default intensity value
Sergio0694 2c60f46
Inverted blend effect placement mode
Sergio0694 3fd58fb
Added CrossFadeEffect to shallow copy page
Sergio0694 387118e
Improved XML docs
Sergio0694 cbbe4ed
Added clamping for XAML effects for Win2D
Sergio0694 2ff52e3
Merge branch 'master' into refactoring/more-win2d-tweaks
michael-hawker d7ce515
Added auto clamping for AcrylicBrush tint opacity
Sergio0694 762e510
Clamped AcrylicBrush blur property for negative value
Sergio0694 21c25e1
Merge branch 'master' into refactoring/more-win2d-tweaks
Sergio0694 b5a04b5
Merge branch 'master' into refactoring/more-win2d-tweaks
Sergio0694 c8535bc
Merge branch 'master' into refactoring/more-win2d-tweaks
Sergio0694 1e3aba8
Merge branch 'master' into refactoring/more-win2d-tweaks
Sergio0694 a376298
Fixed default value for OpacityEffect
Sergio0694 86b80d1
Added ranges in XML docs for exposure effect
Sergio0694 8225e5e
Merge branch 'refactoring/more-win2d-tweaks' of https://github.com/Se…
Sergio0694 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using Microsoft.Toolkit.Uwp.UI.Media.Pipelines; | ||
| using Windows.UI.Xaml.Markup; | ||
|
|
||
| namespace Microsoft.Toolkit.Uwp.UI.Media.Effects | ||
| { | ||
| /// <summary> | ||
| /// A blend effect that merges the current builder with an input one | ||
| /// </summary> | ||
| /// <remarks>This effect maps to the Win2D <see cref="Graphics.Canvas.Effects.CrossFadeEffect"/> effect</remarks> | ||
| [ContentProperty(Name = nameof(Effects))] | ||
| public sealed class CrossFadeEffect : IPipelineEffect | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the input to merge with the current instance (defaults to a <see cref="BackdropSourceExtension"/> with <see cref="Windows.UI.Xaml.Media.AcrylicBackgroundSource.Backdrop"/> source). | ||
| /// </summary> | ||
| public PipelineBuilder Source { get; set; } | ||
michael-hawker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Gets or sets the effects to apply to the input to merge with the current instance | ||
| /// </summary> | ||
| public List<IPipelineEffect> Effects { get; set; } = new List<IPipelineEffect>(); | ||
|
|
||
| private double factor = 0.5; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the The cross fade factor to blend the input effects (default to 0.5, should be in the [0, 1] range) | ||
| /// </summary> | ||
| public double Factor | ||
| { | ||
| get => this.factor; | ||
| set => this.factor = Math.Clamp(value, 0, 1); | ||
| } | ||
|
|
||
| /// <inheritdoc/> | ||
| public PipelineBuilder AppendToPipeline(PipelineBuilder builder) | ||
| { | ||
| PipelineBuilder inputBuilder = Source ?? PipelineBuilder.FromBackdrop(); | ||
|
|
||
| foreach (IPipelineEffect effect in this.Effects) | ||
| { | ||
| inputBuilder = effect.AppendToPipeline(inputBuilder); | ||
| } | ||
|
|
||
| return builder.CrossFade(inputBuilder, (float)Factor); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.