-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Add Abgr32 pixel type, extend IPixel<T> #1886
Add Abgr32 pixel type, extend IPixel<T> #1886
Conversation
@antonfirsov there seem to be failing tests on macos, which may be related to #1730, could you take a look at this: Failing Tests |
/// <summary> | ||
/// Provides optimized overrides for bulk operations. | ||
/// </summary> | ||
internal partial class PixelOperations : PixelOperations<Abgr32> |
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.
Can this be sealed
?
Sealing would open the door in the JIT to allow de-virtualization, especially with dynamic profile guided optimizaiton (D-PGO).
...elFormats/PixelImplementations/PixelOperations/Generated/Abgr32.PixelOperations.Generated.cs
Outdated
Show resolved
Hide resolved
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #1886 +/- ##
=======================================
Coverage 87% 87%
=======================================
Files 957 960 +3
Lines 50474 50972 +498
Branches 6291 6310 +19
=======================================
+ Hits 44252 44731 +479
- Misses 5185 5202 +17
- Partials 1037 1039 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
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.
LGTM, thanks!
This is a breaking change due to IPixel<T>
interface extension.
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.
Nevermind, all good.
Prerequisites
Description
This adds the Abgr32 Pixel Format, as described in issue #1345.
For most of its implementation, I took inspiration from the Bgra32 pixel format code. It includes the SIMD conversions to other RGB based formats, so conversion performance should be pretty good.
I also fixed, what I think is a bug, in IComponentShuffle. Please check if my understanding of byte shuffling is correct.
I've not added Benchmarks, as there weren't any for Bgra32 also. I expect the performance will be similar to the other RGBA Pixel Formats. Let me know if you want me to add benchmarks.