Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Vortetty
Copy link

@Vortetty Vortetty commented Aug 6, 2025

To solve #12 in a fairly user friendly way, exposes the Decompose trait, rgb/yuv conversion, and a yuv_hybrid_compare method. As well as fixing some visibility issues that arose from exposing the utils 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.

wintersys and others added 6 commits August 3, 2025 11:32
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
Copy link
Owner

@ChrisRega ChrisRega left a 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.

wintersys added 2 commits August 12, 2025 20:21
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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 :)

Copy link
Author

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

@ChrisRega
Copy link
Owner

Will merge tomorrow and draft release, thank you for the contribution :)

@ChrisRega ChrisRega merged commit 968b454 into ChrisRega:main Aug 18, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants