LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
Interfaces.h
Go to the documentation of this file.
1 
7 #ifndef LLU_CONTAINERS_INTERFACES_H
8 #define LLU_CONTAINERS_INTERFACES_H
9 
10 #include "LLU/LibraryData.h"
11 
12 namespace LLU {
13 
17  struct ImageInterface {
18 
19  // Provide special member functions
21  ImageInterface() = default;
22  virtual ~ImageInterface() = default;
23  ImageInterface(const ImageInterface&) = default;
24  ImageInterface& operator=(const ImageInterface&) = default;
25  ImageInterface(ImageInterface&&) = default;
26  ImageInterface& operator=(ImageInterface&&) = default;
28 
33  virtual colorspace_t colorspace() const = 0;
34 
39  virtual mint rows() const = 0;
40 
45  virtual mint columns() const = 0;
46 
51  virtual mint slices() const = 0;
52 
57  virtual mint channels() const = 0;
58 
63  virtual bool alphaChannelQ() const = 0;
64 
69  virtual bool interleavedQ() const = 0;
70 
74  virtual bool is3D() const = 0;
75 
80  virtual mint getRank() const = 0;
81 
86  virtual mint getFlattenedLength() const = 0;
87 
93  virtual imagedata_t type() const = 0;
94 
100  virtual void* rawData() const = 0;
101  };
102 
107 
108  // Provide special member functions
110  NumericArrayInterface() = default;
111  virtual ~NumericArrayInterface() = default;
113  NumericArrayInterface& operator=(const NumericArrayInterface&) = default;
115  NumericArrayInterface& operator=(NumericArrayInterface&&) = default;
117 
123  virtual mint getRank() const = 0;
124 
130  virtual mint const* getDimensions() const = 0;
131 
137  virtual mint getFlattenedLength() const = 0;
138 
144  virtual numericarray_data_t type() const = 0;
145 
151  virtual void* rawData() const = 0;
152  };
153 
158 
159  // Provide special member functions
161  TensorInterface() = default;
162  virtual ~TensorInterface() = default;
163  TensorInterface(const TensorInterface&) = default;
164  TensorInterface& operator=(const TensorInterface&) = default;
165  TensorInterface(TensorInterface&&) = default;
166  TensorInterface& operator=(TensorInterface&&) = default;
168 
174  virtual mint getRank() const = 0;
175 
181  virtual mint const* getDimensions() const = 0;
182 
188  virtual mint getFlattenedLength() const = 0;
189 
195  virtual mint type() const = 0;
196 
200  virtual void* rawData() const = 0;
201  };
202 } // namespace LLU
203 
204 #endif // LLU_CONTAINERS_INTERFACES_H
LLU::NumericArrayInterface
Abstract class that defines a basic set of operations on a numeric array.
Definition: Interfaces.h:106
LLU::ImageInterface::colorspace
virtual colorspace_t colorspace() const =0
Get colorspace which describes how colors are represented as numbers.
LLU::TensorInterface::type
virtual mint type() const =0
Get the data type of this tensor.
LLU::ImageInterface::columns
virtual mint columns() const =0
Get number of columns.
LLU::ImageInterface::alphaChannelQ
virtual bool alphaChannelQ() const =0
Check if there is an alpha channel in the image.
LLU
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
LLU::ImageInterface::type
virtual imagedata_t type() const =0
Get the data type of the image.
LLU::NumericArrayInterface::rawData
virtual void * rawData() const =0
Get access to the raw data.
LLU::ImageInterface::rows
virtual mint rows() const =0
Get number of rows.
LibraryData.h
LLU::TensorInterface::getRank
virtual mint getRank() const =0
Get rank.
LLU::TensorInterface::rawData
virtual void * rawData() const =0
Get raw pointer to the data of this tensor.
LLU::ImageInterface::channels
virtual mint channels() const =0
Get number of channels.
LLU::ImageInterface
Abstract class that defines a basic set of operations on an image.
Definition: Interfaces.h:17
LLU::NumericArrayInterface::getRank
virtual mint getRank() const =0
Get rank.
LLU::ImageInterface::interleavedQ
virtual bool interleavedQ() const =0
Check if the image is interleaved.
LLU::TensorInterface
Abstract class that defines a basic set of operations on a tensor.
Definition: Interfaces.h:157
LLU::ImageInterface::getRank
virtual mint getRank() const =0
Get rank.
LLU::ImageInterface::getFlattenedLength
virtual mint getFlattenedLength() const =0
Get the total number of pixels in the image.
LLU::NumericArrayInterface::type
virtual numericarray_data_t type() const =0
Get the data type of this array.
LLU::TensorInterface::getFlattenedLength
virtual mint getFlattenedLength() const =0
Get total length.
LLU::ImageInterface::rawData
virtual void * rawData() const =0
Get access to raw image data.
LLU::ImageInterface::is3D
virtual bool is3D() const =0
Check if the image is 3D.
LLU::NumericArrayInterface::getDimensions
virtual mint const * getDimensions() const =0
Get dimensions.
LLU::TensorInterface::getDimensions
virtual mint const * getDimensions() const =0
Get dimensions.
LLU::ImageInterface::slices
virtual mint slices() const =0
Get number of slices.
LLU::NumericArrayInterface::getFlattenedLength
virtual mint getFlattenedLength() const =0
Get length.