22 #ifndef mia_2d_2dimage_hh
23 #define mia_2d_2dimage_hh
35 #define ATTR_IMAGE_KMEANS_CLASSES "kmeans"
56 typedef std::shared_ptr<C2DImage >
Pointer;
76 virtual C2DImage* clone() const __attribute__((warn_unused_result)) = 0;
116 template <typename T>
186 virtual C2DImage* clone() const __attribute__((warn_unused_result));
189 const_reference operator()(
size_t x,
size_t y)
const {
210 return m_image(l.
x,l.
y);
215 return m_image(l.
x,l.
y);
220 return m_image.begin();
224 const_iterator
end()
const {
225 return m_image.end();
230 return m_image.begin();
235 return m_image.end();
240 return m_image.begin_at(x, y);
245 return m_image.begin_at(x, y);
250 return m_image.begin_range(begin, end);
255 return m_image.end_range(begin, end);
260 return m_image.begin_range(begin, end);
265 return m_image.end_range(begin, end);
275 void get_data_line_x(
size_t y, std::vector<T>& buffer)
const;
278 void get_data_line_y(
size_t x, std::vector<T>& buffer)
const;
281 void put_data_line_x(
size_t y,
const std::vector<T>& buffer);
284 void put_data_line_y(
size_t x,
const std::vector<T>& buffer);
309 template <
typename T,
typename S>
316 cvdebug() << *si++ <<
" expect " << *ri++ <<
"\n";
324 template <
typename S>
325 struct plugin_data_type<
T2DImage<S> > {
365 template <
typename T>
417 typedef __bind_all<T2DImage> Derived;
430 static std::string val2string(
const C2DFVector& value) {
431 std::stringstream sval;
432 sval << value.
x <<
" " << value.
y;
440 static C2DFVector string2val(
const std::string& str) {
441 std::istringstream sval(str);
443 sval >> value.
x >> value.
y;
460 template <
typename O>
468 template <
typename T>
471 copy(image.
begin(), image.
end(), result.begin());
482 return filter(*
this, image);
492 return filter(*
this, *image);