Image.cpp
Go to the documentation of this file.
1 #include "Image.h"
2 
3 #include <sstream>
4 
5 #include <Image/ByteImage.h>
6 
11 
15 
16 
17 namespace visionx::armem_images
18 {
19 
20  template class Image<visionx::armem_images::arondto::ImageRGB>;
21  template class Image<visionx::armem_images::arondto::ImageDepth>;
22 
23 
24  ImageBase::ImageBase(const armarx::armem::MemoryID& instanceID, size_t imageIndex) :
25  instanceID(instanceID), imageIndex(imageIndex)
26  {
27  }
28 
29 
31  {
32  }
33 
34 
35  bool ImageBase::usePixels(CByteImage** inputImages)
36  {
37  return usePixels(inputImages[imageIndex]);
38  }
39 
40 
41  bool ImageBase::usePixels(void** inputPixelBuffers)
42  {
43  return usePixels(inputPixelBuffers[imageIndex]);
44  }
45 
46 
48  {
49  namespace qf = armarx::armem::client::query_fns;
50  queryBuilder
53  }
54 
55 
56  bool ImageBase::areSameSize(const CByteImage& lhs, const CByteImage& rhs)
57  {
58  return lhs.width == rhs.width && lhs.height == rhs.height;
59  }
60 
61 
62  bool ImageBase::areSameSize(const cv::Mat& lhs, const cv::Mat& rhs)
63  {
64  return lhs.cols == rhs.cols && lhs.rows == rhs.rows;
65  }
66 
67 
68  bool ImageBase::areSameSize(const cv::Mat& lhs, const CByteImage& rhs)
69  {
70  return lhs.cols == rhs.width && lhs.rows == rhs.height;
71  }
72 
73 
74  bool ImageBase::areSameSize(const CByteImage& lhs, const cv::Mat& rhs)
75  {
76  return areSameSize(rhs, lhs);
77  }
78 
79 
80  void detail::checkNotNull(void* ptr, const char* what)
81  {
82  ARMARX_CHECK_NOT_NULL(ptr) << what;
83  }
84 
85 }
visionx::armem_images::ImageBase::~ImageBase
virtual ~ImageBase()
Definition: Image.cpp:30
armarx::armem::client::query::ProviderSegmentSelector::entities
EntitySelector & entities()
Start specifying entities.
Definition: selectors.cpp:123
client.h
visionx::armem_images::ImageBase::addQuery
void addQuery(armarx::armem::client::query::Builder &queryBuilder) const
Definition: Image.cpp:47
armarx::armem::client::query::EntitySelector::snapshots
SnapshotSelector & snapshots()
Start specifying entity snapshots.
Definition: selectors.cpp:86
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:25
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:38
visionx::armem_images::detail::checkNotNull
void checkNotNull(void *ptr, const char *what)
Definition: Image.cpp:80
ExpressionException.h
armarx::armem::client::query_fns::latest
std::function< void(query::SnapshotSelector &)> latest()
Definition: query_fns.h:109
visionx::armem_images::ImageBase::areSameSize
static bool areSameSize(const CByteImage &lhs, const CByteImage &rhs)
Definition: Image.cpp:56
TimeUtil.h
Builder.h
armarx::armem::client::query::Builder
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition: Builder.h:22
armarx::armem::client::query::CoreSegmentSelector::providerSegments
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
Definition: selectors.cpp:160
Logging.h
visionx::armem_images::ImageBase::ImageBase
ImageBase(const armarx::armem::MemoryID &instanceID, size_t imageIndex)
Definition: Image.cpp:24
visionx::armem_images::ImageBase::usePixels
virtual bool usePixels(CByteImage **inputImages)
Definition: Image.cpp:35
Variant.h
armarx::armem::client::query_fns::withID
auto withID(const MemoryID &id)
Definition: query_fns.h:20
armarx::armem::client::query_fns
Definition: query_fns.h:6