MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / Iterator

Class Iterator

testbench/main.cpp:99–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98 template <typename T>
99 struct Iterator
100 {
101 Iterator(Mat& m_)
102 : m(m_)
103 {
104 }
105
106 Iterator& operator=(Iterator& o)
107 {
108 m = o.m;
109
110 return *this;
111 }
112
113 T& operator()(int row, int col, int chan)
114 {
115 size_t channels = m.step.buf[1];
116 size_t idx = row * m.cols * channels + col * channels + chan;
117 assert(idx >= 0);
118 assert(idx < m.rows * m.cols * m.step.buf[1]);
119 return (static_cast<T*>(m.data))[idx];
120 }
121
122 Mat& m;
123 };
124};
125
126} // namespace cv

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected