-
Notifications
You must be signed in to change notification settings - Fork 6
Expose YUV Comparison and Utilities #13
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
Conversation
The internal_yuv_hybrid_compare function was doing the image size check which doubles the checks over internal_yuv_hybrid_compare's. move this to yuv_hybrid_compare and check all 3 channels to avoid double checking when using rgb images and check all channels with yuv_hybrid_compare
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.
Thank you for the suggestion, it looks really good and helpful to me, especially since it was spawned by a user request. Please add feature-toggle guarded unit tests to pin the API behavior as we dont ever want to break public API without knowing.
avoids using mixed syntax for lifetimes, per clippy's #[warn(mismatched_lifetime_syntaxes)]
Scenario Outline: Compare newly split yuv channels to expected values | ||
Given the image '<full_image>' is loaded | ||
When comparing yuv channels | ||
Then check split success |
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.
Then check split success | |
Then the split channels match the references |
then steps should be formulated in passive, but this is just a hint - I can fix this later :)
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.
i will keep that in mind for future use- was the first time i'd worked with that test runner
Will merge tomorrow and draft release, thank you for the contribution :) |
To solve #12 in a fairly user friendly way, exposes the
Decompose
trait, rgb/yuv conversion, and ayuv_hybrid_compare
method. As well as fixing some visibility issues that arose from exposing theutils
module.These changes are hidden behind the "yuv_compare" feature flag since it will, in general, probably not be needed by the majority of users. But in more performance critical areas it can yield a good speed boost such as in my more recent project which benefited greatly from swapping to yuv to avoid a significant amount of data copying and format conversion. In other cases where one can use yuv rather than rgb, a similar potential exists. The speed boost is not as great as one may see with gpu-based comparison however it is enough to justify the possibility, saving 5-10% of runtime for me in some cases.