Image.cpp
Go to the documentation of this file.
1 #include "Image.h"
2 
3 #include <sstream>
4 
9 
13 
14 #include <Image/ByteImage.h>
15 
16 namespace visionx::armem_images
17 {
18 
19  template class Image<visionx::armem_images::arondto::ImageRGB>;
20  template class Image<visionx::armem_images::arondto::ImageDepth>;
21 
22  ImageBase::ImageBase(const armarx::armem::MemoryID& instanceID, size_t imageIndex) :
23  instanceID(instanceID), imageIndex(imageIndex)
24  {
25  }
26 
28  {
29  }
30 
31  bool
32  ImageBase::usePixels(CByteImage** inputImages)
33  {
34  return usePixels(inputImages[imageIndex]);
35  }
36 
37  bool
38  ImageBase::usePixels(void** inputPixelBuffers)
39  {
40  return usePixels(inputPixelBuffers[imageIndex]);
41  }
42 
43  void
45  {
46  namespace qf = armarx::armem::client::query_fns;
47  queryBuilder.coreSegments(qf::withID(instanceID))
51  }
52 
53  bool
54  ImageBase::areSameSize(const CByteImage& lhs, const CByteImage& rhs)
55  {
56  return lhs.width == rhs.width && lhs.height == rhs.height;
57  }
58 
59  bool
60  ImageBase::areSameSize(const cv::Mat& lhs, const cv::Mat& rhs)
61  {
62  return lhs.cols == rhs.cols && lhs.rows == rhs.rows;
63  }
64 
65  bool
66  ImageBase::areSameSize(const cv::Mat& lhs, const CByteImage& rhs)
67  {
68  return lhs.cols == rhs.width && lhs.rows == rhs.height;
69  }
70 
71  bool
72  ImageBase::areSameSize(const CByteImage& lhs, const cv::Mat& rhs)
73  {
74  return areSameSize(rhs, lhs);
75  }
76 
77  void
78  detail::checkNotNull(void* ptr, const char* what)
79  {
80  ARMARX_CHECK_NOT_NULL(ptr) << what;
81  }
82 
83 } // namespace visionx::armem_images
visionx::armem_images::ImageBase::~ImageBase
virtual ~ImageBase()
Definition: Image.cpp:27
armarx::armem::client::query::ProviderSegmentSelector::entities
EntitySelector & entities()
Start specifying entities.
Definition: selectors.cpp:135
client.h
visionx::armem_images::ImageBase::addQuery
void addQuery(armarx::armem::client::query::Builder &queryBuilder) const
Definition: Image.cpp:44
armarx::armem::client::query::EntitySelector::snapshots
SnapshotSelector & snapshots()
Start specifying entity snapshots.
Definition: selectors.cpp:92
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
Image.h
query_fns.h
visionx::armem_images::ImageBase::imageIndex
size_t imageIndex
Definition: Image.h:74
visionx::armem_images::ImageBase::instanceID
armarx::armem::MemoryID instanceID
Definition: Image.h:73
visionx::armem_images
Definition: ImageReader.cpp:29
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::client::query::Builder::coreSegments
CoreSegmentSelector & coreSegments()
Start specifying core segments.
Definition: Builder.cpp:42
visionx::armem_images::detail::checkNotNull
void checkNotNull(void *ptr, const char *what)
Definition: Image.cpp:78
ExpressionException.h
armarx::armem::client::query_fns::latest
std::function< void(query::SnapshotSelector &)> latest()
Definition: query_fns.h:81
visionx::armem_images::ImageBase::areSameSize
static bool areSameSize(const CByteImage &lhs, const CByteImage &rhs)
Definition: Image.cpp:54
TimeUtil.h
Builder.h
armarx::armem::client::query::Builder
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition: Builder.h:21
armarx::armem::client::query::CoreSegmentSelector::providerSegments
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
Definition: selectors.cpp:178
Logging.h
visionx::armem_images::ImageBase::ImageBase
ImageBase(const armarx::armem::MemoryID &instanceID, size_t imageIndex)
Definition: Image.cpp:22
visionx::armem_images::ImageBase::usePixels
virtual bool usePixels(CByteImage **inputImages)
Definition: Image.cpp:32
Variant.h
armarx::armem::client::query_fns::withID
auto withID(const MemoryID &id)
Definition: query_fns.h:15
armarx::armem::client::query_fns
Definition: query_fns.h:5