LArOpenCV  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ImageManager.cxx
Go to the documentation of this file.
1 #ifndef __IMAGEMANAGER_CXX__
2 #define __IMAGEMANAGER_CXX__
3 
4 #include "ImageManager.h"
5 
6 namespace larcv {
7 
8  void ImageManager::push_back(const ::cv::Mat& img, const larcv::ImageMeta& meta)
9  {
10  ::cv::Mat res;
11  img.copyTo(res);
12  _mat_v.push_back(res);
13  _meta_v.push_back(meta);
14  }
15 
16  ::cv::Mat& ImageManager::img_at(size_t index)
17  {
18  if(index >= _mat_v.size()) throw larbys("Requested image index exceeds available image count");
19  return _mat_v[index];
20  }
21 
23  {
24  if(index >= _meta_v.size()) throw larbys("Requested meta data index exceeds available image count");
25  return _meta_v[index];
26  }
27 
29  { _mat_v.clear(); _meta_v.clear(); }
30 
31 }
32 #endif