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

Win2d Path Mini Language Parser added. #3430

Closed
wants to merge 11 commits into from
Closed

Win2d Path Mini Language Parser added. #3430

wants to merge 11 commits into from

Conversation

ratishphilip
Copy link
Contributor

@ratishphilip ratishphilip commented Aug 13, 2020

Fixes #3421

WPF has a Path Mini Language which is used to describe geometric paths and figures. Support for a similar language does not exist in Win2d library. CanvasPathGeometry class aims to resolve that.

PR Type

What kind of change does this PR introduce?

Feature

What is the current behavior?

No parser for converting SVG path data to CanvasGeometry exists. Moreover, no mini language exists for defining Brushes, Strokes and StrokeStyles.

What is the new behavior?

I have defined the Win2d Path Mini Language, which is a superset of the Path Language specification in SVG and can be used to define the following

  • CanvasGeometry
  • Color (in hex format or Vector4 format)
  • Various brushes deriving from ICanvasBrush
    • SolidColorBrush
    • LinearGradientBrush
    • LinearGradientBrush with GradientStopHdr
    • RadialGradientBrush
    • RadialGradientBrush with GradientStopHdr
  • CanvasStrokeStyle
  • CanvasStroke which derives from ICanvasStroke (an interface which encapsulates the attributes of a stroke - Width, Brush, Style and Transform)

I have implemented the CanvasPathGeometry class which contains a set of static helper methods which enable the parsing of Win2d Path Mini Language as string and convert them to appropriate CanvasGeometry, Color, ICanvasBrush or ICanvasStroke. Also I have added extension methods to Compositor, CanvasPathBuilder and CanvasDrawingSession to build upon the aforementioned helper methods.

PR Checklist

Please check if your PR fulfills the following requirements:

@ghost
Copy link

ghost commented Aug 13, 2020

Thanks ratishphilip for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker and azchohfi August 13, 2020 17:51
@net-foundation-cla
Copy link

net-foundation-cla bot commented Aug 13, 2020

CLA assistant check
All CLA requirements met.

@net-foundation-cla
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ ratishphilip sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@ghost ghost requested a review from Kyaa-dost August 13, 2020 17:52
@ghost ghost added the feature request 📬 A request for new changes to improve functionality label Aug 13, 2020
@michael-hawker
Copy link
Member

@ratishphilip I think the initial build is failing as some files are probably missing the header, you can run the UpdateHeaders script from the build directory to automatically fix this.

@michael-hawker
Copy link
Member

Hey @ratishphilip, we just started to get to take a look at this, but we didn't notice this was coming from your master branch. Can you make sure this is coming from a feature branch in your fork? It gets messy and complex sometimes otherwise going from a master of a fork. Thanks!

@ratishphilip
Copy link
Contributor Author

@michael-hawker Could you please let me know if I should abandon this PR and submit a new one.
Should I the same for the Docs PR?

@Rosuavio
Copy link
Contributor

@ratishphilip Its too much trouble don't worry about it for this branch. We are starting to add documentation instructing contributors to make feature branches. For the future I would make a feature branch.

@michael-hawker
Copy link
Member

@RosarioPulella the only problem here is that it's harder to resolve the conflict file when it's on the master branch.

@ratishphilip if you don't mind, it may be easier to resubmit a new PR from a feature branch, and you can just resolve the conflict at that same point here as well. Sorry for the troubles!

@ratishphilip
Copy link
Contributor Author

Ok @michael-hawker, I will make a new PR and resubmit. Kindly reject this PR.

@michael-hawker
Copy link
Member

Closing and waiting for new PR

@ratishphilip
Copy link
Contributor Author

@michael-hawker thanks... could you please close the docs PR as well. I will resubmit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 📬 A request for new changes to improve functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Adding Win2d Path Mini Language Parser to WCT
3 participants