-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Rename Pixel Shader Extensions and Delegates #1096
Conversation
Looks great! |
Codecov Report
@@ Coverage Diff @@
## master #1096 +/- ##
==========================================
+ Coverage 81.49% 81.53% +0.03%
==========================================
Files 704 704
Lines 29389 29380 -9
Branches 3290 3290
==========================================
+ Hits 23951 23954 +3
+ Misses 4745 4733 -12
Partials 693 693
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few naming-related concerns for future proofness.
In the close future, after making R ↔ G ↔ B ↔ A
shuffling cheap, we can extend the API like this:
public static IImageProcessingContext ProcessPixelRowsAs<TPixel>(this IImageProcessingContext source, PixelRowOperation<TPixel> rowOperation) where TPixel : struct, IPixel<TPixel>;
It can be used like following:
image.ProcessPixelRowsAs<Rgba32>(span => { .... });
This will put the new naming into context, it's fine that is more verbose for the Vector4
case.
src/ImageSharp/Processing/Processors/Effects/PixelRowDelegateProcessor.cs
Outdated
Show resolved
Hide resolved
@antonfirsov I'm a bit confused, why do we want to add overloads that work with a specific pixel type, given that those will prevent the JITter from just compiling the I mean, my fear is that a general developer presented with both the |
@Sergio0694 it's 4x more compact in memory, conversion is much faster, if done right (NOP for |
@antonfirsov Ah, yeah I hadn't considered that. I personally don't get why the Also I might be wrong here, but I was wondering:
Thanks in advance, I'm just trying to learn as much as I can from you guys 😄 |
@SixLabors/core Any blockers here or can I merge? |
@JimBobSquarePants give me 10 minutes. |
@Sergio0694 this is the .NET Core 2.1+ It's the fastest thing we can do, but still expensive. In comparison, a Of course, in case of more complex processing operations, it would be compensated by using |
@antonfirsov Ah, yeah I see now, makes perfect sense. Thanks! 😄 |
Prerequisites
Description
The
PixelShader
extensions, processors and delegates were too suggestive of GPU based functionality so the decision was made to rename them.All functionality is the same only classes and delegates were renamed.
cc. @Sergio0694