Conversation
6b0f186 to
853ab9f
Compare
|
@TolyaTalamanov fyi |
47fc882 to
eb334fc
Compare
|
|
||
| template<typename T = uchar> T* ptr(int y = 0, int x = 0) { | ||
| return reinterpret_cast<T*>(m_data + m_step*y + x*CV_ELEM_SIZE(type())); | ||
| return reinterpret_cast<T*>(m_data + step()*y + x*CV_ELEM_SIZE(type())); |
There was a problem hiding this comment.
What is step() here in the 2d case? what is it in, hm, 3d case? would this function work in 3d or 4d case?
There was a problem hiding this comment.
step() returns step value which should be applied when iterating on the first (with biggest order) dimension of the View. So it's a "width" step in 2d case as it was before, semantics unchanged, it's a "height" step in 3d case and "plane" step in 4d case.
There was a problem hiding this comment.
Regarding applicability in non-2d cases it's a good question if it even should be called in these cases with x != 0 and x != 0, maybe I should place an assert on that. Or maybe it's worth to generalize this method for any number of dimensions
5bf2514 to
22039e6
Compare
|
@dmatveev updated |
22039e6 to
5ef7964
Compare
5ef7964 to
724001a
Compare
|
@dmatveev updated, please take a look |
|
@alalek this one can be merged |
Summary
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.