-
-
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 La16 and La32 IPixel formats. #1062
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1062 +/- ##
==========================================
+ Coverage 89.94% 90.03% +0.09%
==========================================
Files 1131 1145 +14
Lines 50633 51762 +1129
Branches 3715 3783 +68
==========================================
+ Hits 45542 46605 +1063
- Misses 4335 4402 +67
+ Partials 756 755 -1
Continue to review full report at Codecov.
|
Things to consider with returning anything but |
Yeah, I had a think about that and I would expect that behavior. The option is always there to use the generic version if need be. |
A few remarks (did not have the chance to go through the code changes though):
|
I'm beginning to think that returning different pixelformat types is a bad idea. It adds complexity to the internal workings of our decoders that I can't enforce. I'm going to revert the JpegDecoder changes in this PR but all other changes still stand. Update... Yep, definitely sticking to @antonfirsov When you have a moment I want to talk Core 3+ and a plan to perform the Jpeg IDCT + Colorspace transforms via intrinsics in a manner that matches other high performance decoders. I saw a 33% slowdown when decoding to |
It's worth to do so in long term, because it is an enabler for memory & CPU optimizations together with the shuffling intrinsics which are not yet utilized. The speedup and the reduced memory footprint for the most common (3 component, alpha-free) jpeg thumbnail making use case should be significant enough to justify the extra complexity. Basically, all major imaging libraries work like this, for a good reason. Therefore, tying our own hands by communicating in docs that an untyped There are many ways to handle the drawing composability issues - most straightforward is docs. |
@antonfirsov Interestingly enough that was actually the case in some areas of the documentation already, it was quite inconsistent. I'll revert that documentation change for now and will wait to change the type until after we have those optimizations. (Hopefully something we can begin very soon once we have merged #1061) |
Just pushed some changes to fix the casing of any Metadata related files. It was doing my head in. |
That is most likely an accidental leftover for #907.
Okkay, let's jump into it :) I'm prepering an analysis right now. Sorry in advance, but it will be long as hell. I'm trying best to explain things as deeply and clearly as possible. |
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 remarks and suggestions, but in principle, everything is OK.
Prerequisites
Description
This PR acts as a precursor to another planned PR building upon the work done adding a non-generic API to the library #907
The planned work will change the behavior of the non-genericImage.Load()
behavior to select the correct pixel format to decode images to rather than defaulting toRgba32
.This PR lays the groundwork to allow this by adding missing pixel formats.The above is no longer the plan, rather we make it easier for users to make informed pixel format choices by inspecting metadata.
La32
andLa16
, pixel formats representing luminance and alpha at 8-bit and 16-bit per component.Gray8
,Gray16
, andAlpha8
toL8
,L16
, andA8
for consistancyPixelOperations
overloads and tests for the new types and the missing one forBgra5551
.PngDecoder
to use new pixel formats when decoding.Updates theJpegDecoder
to decode toRgb24
orL8
instead ofRgba32
.ImageMetadata
andImageFrameMetadata
to make it easier to return format specific metadata.I appreciate there's a lot to read but that's the nature of the
IPixel
API.