Adding functions rbegin() and rend() functions to matrix class.#19967
Merged
alalek merged 5 commits intoopencv:masterfrom May 20, 2021
Merged
Adding functions rbegin() and rend() functions to matrix class.#19967alalek merged 5 commits intoopencv:masterfrom
alalek merged 5 commits intoopencv:masterfrom
Conversation
Contributor
|
@HattrickGenerator, thank you for the contribution! Please, add regression tests for this functionality. |
6 tasks
Contributor
Author
|
@vpisarev, thanks for your comment. A contributor wrote a test for it and I merged it. Do I open a new PR in order to re-run the jenkins builds + tests? |
alalek
reviewed
May 11, 2021
Member
|
Please:
|
This is important to be more standard compliant with C++ and an ever increasing number of people using standard algorithms for better code readability- and maintainability. The functions are copy pated from their counterparts (even though they should probably call the counterparts but this gave me some troube). They return iterators using std::reverse_iterators Follow up of an open feature request: opencv#4641
…don't need to repeat the template argument. An instantiating cv::Mat_<int> for example can call it's rbegin() function and doesn't need rbegin<int>() with this convience addition. Follows what is done for forward iterators
…ed for opencv mat constructor)
Contributor
Author
|
Fixed the warning under windows and rebased my branch on master to keep a linear history. |
Merged
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
* Adding functions rbegin() and rend() functions to matrix class. This is important to be more standard compliant with C++ and an ever increasing number of people using standard algorithms for better code readability- and maintainability. The functions are copy pated from their counterparts (even though they should probably call the counterparts but this gave me some troube). They return iterators using std::reverse_iterators Follow up of an open feature request: opencv#4641 * Fix rbegin() and rend() and provide tests for them * Removing unnecessary whitespaces * Adding rbegin and rend to Mat_ class with the right parameters so we don't need to repeat the template argument. An instantiating cv::Mat_<int> for example can call it's rbegin() function and doesn't need rbegin<int>() with this convience addition. Follows what is done for forward iterators * static cast the vector size (return size_t) to an int (that is required for opencv mat constructor) Co-authored-by: Stefan <stefan.gerl@tum.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is important to be more standard compliant with C++ and an ever increasing number of people using standard algorithms for better code readability- and maintainability.
The functions are copy pasted from their counterparts (even though they should probably call the counterparts but this gave me some trouble).
They return iterators using std::reverse_iterators
Follow up of an open feature request:
#4641
Edit: Additionally there should be a test implemented for it. This still has to be done.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.