1 #ifndef OPENPOSE_CORE_ARRAY_HPP
2 #define OPENPOSE_CORE_ARRAY_HPP
6 #include <opencv2/core/core.hpp>
30 explicit Array(
const int size);
38 explicit Array(
const std::vector<int>& sizes = {});
47 Array(
const int size,
const T value);
56 Array(
const std::vector<int>& sizes,
const T value);
65 Array(
const int size, T*
const dataPtr);
74 Array(
const std::vector<int>& sizes, T*
const dataPtr);
124 void reset(
const int size);
133 void reset(
const std::vector<int>& sizes = {});
142 void reset(
const int size,
const T value);
152 void reset(
const std::vector<int>& sizes,
const T value);
159 void setFrom(
const cv::Mat& cvMat);
166 void setTo(
const T value);
177 return (mVolume == 0);
196 int getSize(
const int index)
const;
231 size_t getVolume(
const int indexA,
const int indexB)
const;
355 inline const T&
operator[](
const std::vector<int>& indexes)
const
367 inline T&
at(
const int index)
369 return commonAt(index);
379 inline const T&
at(
const int index)
const
381 return commonAt(index);
391 inline T&
at(
const std::vector<int>& indexes)
393 return at(getIndexAndCheck(indexes));
403 inline const T&
at(
const std::vector<int>& indexes)
const
405 return at(getIndexAndCheck(indexes));
423 std::vector<int> mSize;
425 std::shared_ptr<T> spData;
427 std::pair<bool, cv::Mat> mCvMatData;
436 int getIndex(
const std::vector<int>& indexes)
const;
445 int getIndexAndCheck(
const std::vector<int>& indexes)
const;
452 T& commonAt(
const int index)
const;
454 void resetAuxiliary(
const std::vector<int>& sizes, T*
const dataPtr =
nullptr);
461 #endif // OPENPOSE_CORE_ARRAY_HPP
const cv::Mat & getConstCvMat() const
std::array< T, N > array
Definition: cl2.hpp:594
T & operator[](const std::vector< int > &indexes)
Definition: array.hpp:343
T & at(const int index)
Definition: array.hpp:367
void setFrom(const cv::Mat &cvMat)
std::vector< int > getStride() const
Array< T > & operator=(const Array< T > &array)
size_t getNumberDimensions() const
Definition: array.hpp:209
const T & at(const std::vector< int > &indexes) const
Definition: array.hpp:403
void setTo(const T value)
const T & at(const int index) const
Definition: array.hpp:379
#define OVERLOAD_C_OUT(className)
Definition: macros.hpp:60
T * getPtr()
Definition: array.hpp:255
bool empty() const
Definition: array.hpp:175
size_t getVolume() const
Definition: array.hpp:219
T & operator[](const int index)
Definition: array.hpp:310
T * getPybindPtr() const
Definition: array.hpp:274
void reset(const int size)
const T & operator[](const std::vector< int > &indexes) const
Definition: array.hpp:355
const T * getConstPtr() const
Definition: array.hpp:264
const std::string toString() const
std::string printSize() const
const T & operator[](const int index) const
Definition: array.hpp:326
T & at(const std::vector< int > &indexes)
Definition: array.hpp:391
std::vector< int > getSize() const
Definition: array.hpp:185
std::string string
Definition: cl2.hpp:574