Represents shape of a matrix/tensor. Previously, MatShape was defined as an alias of std::vector<int>, but now we use a special structure that provides a few extra benefits:
More...
#include <opencv2/core/mat.hpp>
|
| MatShape () |
|
template<class _It > |
| MatShape (_It begin, _It end) |
|
| MatShape (const int *begin, const int *end, DataLayout layout=DATA_LAYOUT_UNKNOWN, int C=0) |
|
| MatShape (const MatShape &shape) |
|
| MatShape (const std::vector< int > &shape, DataLayout layout=DATA_LAYOUT_UNKNOWN, int C=0) |
|
| MatShape (int dims, int value, DataLayout layout=DATA_LAYOUT_UNKNOWN) |
|
| MatShape (size_t dims, const int *sizes=nullptr, DataLayout layout=DATA_LAYOUT_UNKNOWN, int C=0) |
|
| MatShape (size_t dims, int value, DataLayout layout=DATA_LAYOUT_UNKNOWN) |
|
| MatShape (std::initializer_list< int > shape) |
|
template<class _It > |
void | assign (_It begin, _It end) |
|
void | assign (const int *begin, const int *end) |
|
void | assign (int newSize, int value) |
|
void | assign (size_t newSize, int value) |
|
void | assign_ (const int *begin, const int *end) |
|
int & | back () |
|
const int & | back () const |
|
int * | begin () |
|
const int * | begin () const |
|
void | clear () |
|
int * | data () |
|
const int * | data () const |
|
void | emplace_back (int value) |
|
bool | empty () const |
|
int * | end () |
|
const int * | end () const |
|
void | erase (int *where) |
|
MatShape | expand (const MatShape &another) const |
|
MatShape | fromBlock (DataLayout newLayout) const |
|
bool | hasSymbols () const |
|
template<class _It > |
void | insert (int *where, _It begin, _It end) |
|
void | insert (int *where, const int *begin, const int *end) |
|
void | insert (int *where, int count, int value) |
|
void | insert (int *where, int value) |
|
void | insert (int *where, size_t count, int value) |
|
void | insert_ (int *where, const int *begin, const int *end) |
|
bool | isScalar () const |
|
MatShape & | operator= (const MatShape &shape) |
|
int & | operator[] (size_t idx) |
|
const int & | operator[] (size_t idx) const |
|
void | push_back (int value) |
|
void | reserve (size_t maxSize) |
|
void | resize (size_t newSize, int value=0) |
|
size_t | size () const |
|
std::string | str () const |
|
MatShape | toBlock (int C0) const |
|
size_t | total () const |
|
Represents shape of a matrix/tensor. Previously, MatShape was defined as an alias of std::vector<int>, but now we use a special structure that provides a few extra benefits:
- avoids any heap operations, since the shape is stored in a plain array. This reduces overhead of shape inference etc.
- includes information about the layout, including the actual number of channels ('C') in the case of block layout.
- distinguishes between empty shape (total() == 0) and 0-dimensional shape (dims == 0, but total() == 1).
◆ anonymous enum
◆ MatShape() [1/9]
cv::MatShape::MatShape |
( |
| ) |
|
◆ MatShape() [2/9]
◆ MatShape() [3/9]
◆ MatShape() [4/9]
◆ MatShape() [5/9]
◆ MatShape() [6/9]
◆ MatShape() [7/9]
cv::MatShape::MatShape |
( |
std::initializer_list< int > |
shape | ) |
|
|
explicit |
◆ MatShape() [8/9]
cv::MatShape::MatShape |
( |
const MatShape & |
shape | ) |
|
◆ MatShape() [9/9]
template<class _It >
cv::MatShape::MatShape |
( |
_It |
begin, |
|
|
_It |
end |
|
) |
| |
◆ assign() [1/4]
template<class _It >
void cv::MatShape::assign |
( |
_It |
begin, |
|
|
_It |
end |
|
) |
| |
◆ assign() [2/4]
void cv::MatShape::assign |
( |
const int * |
begin, |
|
|
const int * |
end |
|
) |
| |
◆ assign() [3/4]
void cv::MatShape::assign |
( |
int |
newSize, |
|
|
int |
value |
|
) |
| |
◆ assign() [4/4]
void cv::MatShape::assign |
( |
size_t |
newSize, |
|
|
int |
value |
|
) |
| |
◆ assign_()
void cv::MatShape::assign_ |
( |
const int * |
begin, |
|
|
const int * |
end |
|
) |
| |
◆ back() [1/2]
int & cv::MatShape::back |
( |
| ) |
|
◆ back() [2/2]
const int & cv::MatShape::back |
( |
| ) |
const |
◆ begin() [1/2]
int * cv::MatShape::begin |
( |
| ) |
|
◆ begin() [2/2]
const int * cv::MatShape::begin |
( |
| ) |
const |
◆ clear()
void cv::MatShape::clear |
( |
| ) |
|
◆ data() [1/2]
int * cv::MatShape::data |
( |
| ) |
|
◆ data() [2/2]
const int * cv::MatShape::data |
( |
| ) |
const |
◆ emplace_back()
void cv::MatShape::emplace_back |
( |
int |
value | ) |
|
◆ empty()
bool cv::MatShape::empty |
( |
| ) |
const |
◆ end() [1/2]
int * cv::MatShape::end |
( |
| ) |
|
◆ end() [2/2]
const int * cv::MatShape::end |
( |
| ) |
const |
◆ erase()
void cv::MatShape::erase |
( |
int * |
where | ) |
|
◆ expand()
◆ fromBlock()
◆ hasSymbols()
bool cv::MatShape::hasSymbols |
( |
| ) |
const |
◆ insert() [1/5]
template<class _It >
void cv::MatShape::insert |
( |
int * |
where, |
|
|
_It |
begin, |
|
|
_It |
end |
|
) |
| |
◆ insert() [2/5]
void cv::MatShape::insert |
( |
int * |
where, |
|
|
const int * |
begin, |
|
|
const int * |
end |
|
) |
| |
◆ insert() [3/5]
void cv::MatShape::insert |
( |
int * |
where, |
|
|
int |
count, |
|
|
int |
value |
|
) |
| |
◆ insert() [4/5]
void cv::MatShape::insert |
( |
int * |
where, |
|
|
int |
value |
|
) |
| |
◆ insert() [5/5]
void cv::MatShape::insert |
( |
int * |
where, |
|
|
size_t |
count, |
|
|
int |
value |
|
) |
| |
◆ insert_()
void cv::MatShape::insert_ |
( |
int * |
where, |
|
|
const int * |
begin, |
|
|
const int * |
end |
|
) |
| |
◆ isScalar()
bool cv::MatShape::isScalar |
( |
| ) |
const |
◆ operator=()
◆ operator[]() [1/2]
int & cv::MatShape::operator[] |
( |
size_t |
idx | ) |
|
◆ operator[]() [2/2]
const int & cv::MatShape::operator[] |
( |
size_t |
idx | ) |
const |
◆ push_back()
void cv::MatShape::push_back |
( |
int |
value | ) |
|
◆ reserve()
void cv::MatShape::reserve |
( |
size_t |
maxSize | ) |
|
◆ resize()
void cv::MatShape::resize |
( |
size_t |
newSize, |
|
|
int |
value = 0 |
|
) |
| |
◆ scalar()
static MatShape cv::MatShape::scalar |
( |
| ) |
|
|
static |
◆ size()
size_t cv::MatShape::size |
( |
| ) |
const |
◆ str()
std::string cv::MatShape::str |
( |
| ) |
const |
◆ toBlock()
MatShape cv::MatShape::toBlock |
( |
int |
C0 | ) |
const |
◆ total()
size_t cv::MatShape::total |
( |
| ) |
const |
◆ dims
◆ layout
The documentation for this struct was generated from the following file: