OpenCV  4.9.0
Open Source Computer Vision
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cv::cann::AscendMat Class Reference

#include <opencv2/cann.hpp>

Classes

class  Allocator
 

Public Member Functions

 AscendMat (AscendMat::Allocator *allocator_=AscendMat::defaultAllocator())
 default constructor More...
 
 AscendMat (int rows, int cols, int type, AscendMat::Allocator *allocator=AscendMat::defaultAllocator())
 constructs AscendMat of the specified size and type More...
 
 AscendMat (Size size, int type, AscendMat::Allocator *allocator=AscendMat::defaultAllocator())
 constructs AscendMat of the specified size and type More...
 
 AscendMat (int rows, int cols, int type, Scalar &s, AscendMat::Allocator *allocator=AscendMat::defaultAllocator())
 constructs AscendMat and fills it with the specified value s More...
 
 AscendMat (Size size, int type, Scalar &s, AscendMat::Allocator *allocator=AscendMat::defaultAllocator())
 constructs AscendMat and fills it with the specified value s More...
 
 AscendMat (const AscendMat &m)
 copy constructor More...
 
 AscendMat (InputArray _m, const Rect &roi)
 constructs AscendMat by crop a certain area from another More...
 
 AscendMat (InputArray _m, const Rect &roi, AscendStream &stream)
 
 AscendMat (InputArray arr, AscendStream &stream, AscendMat::Allocator *allocator=AscendMat::defaultAllocator())
 builds AscendMat from host memory (Blocking call) More...
 
int channels () const
 returns number of channels More...
 
void convertTo (AscendMat &dst, int rtype) const
 converts AscendMat to another datatype (Blocking call) More...
 
void convertTo (AscendMat &dst, int rtype, AscendStream &stream) const
 converts AscendMat to another datatype (Non-Blocking call) More...
 
void convertTo (AscendMat &dst, AscendStream &stream) const
 converts AscendMat to another datatype, dst mat is allocated. (Non-Blocking call) More...
 
void create (int rows, int cols, int type)
 allocates new AscendMat data unless the AscendMat already has specified size and type More...
 
int depth () const
 returns element type More...
 
void download (OutputArray dst) const
 download data from AscendMat to host (Blocking call) More...
 
void download (OutputArray dst, AscendStream &stream) const
 download data from AscendMat to host (Non-Blocking call) More...
 
size_t elemSize () const
 returns element size in bytes More...
 
size_t elemSize1 () const
 returns the size of element channel in bytes More...
 
bool empty () const
 returns true if AscendMat data is NULL More...
 
bool isContinuous () const
 
AscendMatoperator= (const AscendMat &m)
 assignment operators More...
 
AscendMatsetTo (const Scalar &s)
 sets some of the AscendMat elements to s (Blocking call) More...
 
AscendMatsetTo (const Scalar &s, AscendStream &stream)
 sets some of the AscendMat elements to s (Non-Blocking call) More...
 
AscendMatsetTo (float sc)
 sets all of the AscendMat elements to float (Blocking call) More...
 
AscendMatsetTo (float sc, AscendStream &stream)
 sets all of the AscendMat elements to float (Non-Blocking call) More...
 
Size size () const
 returns AscendMat size : width == number of columns, height == number of rows More...
 
size_t step1 () const
 returns step/elemSize1() More...
 
void swap (AscendMat &mat)
 swaps with other smart pointer More...
 
int type () const
 returns element type More...
 
void updateContinuityFlag ()
 internal use method: updates the continuity flag More...
 
void upload (InputArray arr)
 upload host memory data to AscendMat (Blocking call) More...
 
void upload (InputArray arr, AscendStream &stream)
 upload host memory data to AscendMat (Non-Blocking call) More...
 

Static Public Member Functions

static AscendMat::AllocatordefaultAllocator ()
 Create default allocator for AscendMat. This allocator alloc memory from device for specific size. More...
 
static void setDefaultAllocator (AscendMat::Allocator *allocator)
 Set allocator for AscendMat. More...
 

Public Attributes

Allocatorallocator
 allocator More...
 
int cols
 
std::shared_ptr< uchardata
 pointer to the data More...
 
const uchardataend
 
uchardatastart
 helper fields used in locateROI and adjustROI More...
 
int flags
 
int rows
 the number of rows and columns More...
 
size_t step
 a distance between successive rows in bytes; includes the gap if any More...
 

Constructor & Destructor Documentation

◆ AscendMat() [1/9]

cv::cann::AscendMat::AscendMat ( AscendMat::Allocator allocator_ = AscendMat::defaultAllocator())
explicit

default constructor

◆ AscendMat() [2/9]

cv::cann::AscendMat::AscendMat ( int  rows,
int  cols,
int  type,
AscendMat::Allocator allocator = AscendMat::defaultAllocator() 
)

constructs AscendMat of the specified size and type

◆ AscendMat() [3/9]

cv::cann::AscendMat::AscendMat ( Size  size,
int  type,
AscendMat::Allocator allocator = AscendMat::defaultAllocator() 
)

constructs AscendMat of the specified size and type

◆ AscendMat() [4/9]

cv::cann::AscendMat::AscendMat ( int  rows,
int  cols,
int  type,
Scalar s,
AscendMat::Allocator allocator = AscendMat::defaultAllocator() 
)

constructs AscendMat and fills it with the specified value s

◆ AscendMat() [5/9]

cv::cann::AscendMat::AscendMat ( Size  size,
int  type,
Scalar s,
AscendMat::Allocator allocator = AscendMat::defaultAllocator() 
)

constructs AscendMat and fills it with the specified value s

◆ AscendMat() [6/9]

cv::cann::AscendMat::AscendMat ( const AscendMat m)

copy constructor

◆ AscendMat() [7/9]

cv::cann::AscendMat::AscendMat ( InputArray  _m,
const Rect roi 
)

constructs AscendMat by crop a certain area from another

◆ AscendMat() [8/9]

cv::cann::AscendMat::AscendMat ( InputArray  _m,
const Rect roi,
AscendStream stream 
)

◆ AscendMat() [9/9]

cv::cann::AscendMat::AscendMat ( InputArray  arr,
AscendStream stream,
AscendMat::Allocator allocator = AscendMat::defaultAllocator() 
)
explicit

builds AscendMat from host memory (Blocking call)

Member Function Documentation

◆ channels()

int cv::cann::AscendMat::channels ( ) const

returns number of channels

◆ convertTo() [1/3]

void cv::cann::AscendMat::convertTo ( AscendMat dst,
int  rtype 
) const

converts AscendMat to another datatype (Blocking call)

◆ convertTo() [2/3]

void cv::cann::AscendMat::convertTo ( AscendMat dst,
int  rtype,
AscendStream stream 
) const

converts AscendMat to another datatype (Non-Blocking call)

◆ convertTo() [3/3]

void cv::cann::AscendMat::convertTo ( AscendMat dst,
AscendStream stream 
) const

converts AscendMat to another datatype, dst mat is allocated. (Non-Blocking call)

◆ create()

void cv::cann::AscendMat::create ( int  rows,
int  cols,
int  type 
)

allocates new AscendMat data unless the AscendMat already has specified size and type

◆ defaultAllocator()

static AscendMat::Allocator* cv::cann::AscendMat::defaultAllocator ( )
static

Create default allocator for AscendMat. This allocator alloc memory from device for specific size.

◆ depth()

int cv::cann::AscendMat::depth ( ) const

returns element type

◆ download() [1/2]

void cv::cann::AscendMat::download ( OutputArray  dst) const

download data from AscendMat to host (Blocking call)

◆ download() [2/2]

void cv::cann::AscendMat::download ( OutputArray  dst,
AscendStream stream 
) const

download data from AscendMat to host (Non-Blocking call)

◆ elemSize()

size_t cv::cann::AscendMat::elemSize ( ) const

returns element size in bytes

◆ elemSize1()

size_t cv::cann::AscendMat::elemSize1 ( ) const

returns the size of element channel in bytes

◆ empty()

bool cv::cann::AscendMat::empty ( ) const

returns true if AscendMat data is NULL

◆ isContinuous()

bool cv::cann::AscendMat::isContinuous ( ) const

returns true iff the AscendMat data is continuous (i.e. when there are no gaps between successive rows)

◆ operator=()

AscendMat& cv::cann::AscendMat::operator= ( const AscendMat m)

assignment operators

◆ setDefaultAllocator()

static void cv::cann::AscendMat::setDefaultAllocator ( AscendMat::Allocator allocator)
static

Set allocator for AscendMat.

Parameters
allocator

◆ setTo() [1/4]

AscendMat& cv::cann::AscendMat::setTo ( const Scalar s)

sets some of the AscendMat elements to s (Blocking call)

◆ setTo() [2/4]

AscendMat& cv::cann::AscendMat::setTo ( const Scalar s,
AscendStream stream 
)

sets some of the AscendMat elements to s (Non-Blocking call)

◆ setTo() [3/4]

AscendMat& cv::cann::AscendMat::setTo ( float  sc)

sets all of the AscendMat elements to float (Blocking call)

◆ setTo() [4/4]

AscendMat& cv::cann::AscendMat::setTo ( float  sc,
AscendStream stream 
)

sets all of the AscendMat elements to float (Non-Blocking call)

◆ size()

Size cv::cann::AscendMat::size ( ) const

returns AscendMat size : width == number of columns, height == number of rows

◆ step1()

size_t cv::cann::AscendMat::step1 ( ) const

returns step/elemSize1()

◆ swap()

void cv::cann::AscendMat::swap ( AscendMat mat)

swaps with other smart pointer

◆ type()

int cv::cann::AscendMat::type ( ) const

returns element type

◆ updateContinuityFlag()

void cv::cann::AscendMat::updateContinuityFlag ( )

internal use method: updates the continuity flag

◆ upload() [1/2]

void cv::cann::AscendMat::upload ( InputArray  arr)

upload host memory data to AscendMat (Blocking call)

◆ upload() [2/2]

void cv::cann::AscendMat::upload ( InputArray  arr,
AscendStream stream 
)

upload host memory data to AscendMat (Non-Blocking call)

Member Data Documentation

◆ allocator

Allocator* cv::cann::AscendMat::allocator

allocator

◆ cols

int cv::cann::AscendMat::cols

◆ data

std::shared_ptr<uchar> cv::cann::AscendMat::data

pointer to the data

◆ dataend

const uchar* cv::cann::AscendMat::dataend

◆ datastart

uchar* cv::cann::AscendMat::datastart

helper fields used in locateROI and adjustROI

◆ flags

int cv::cann::AscendMat::flags

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels

◆ rows

int cv::cann::AscendMat::rows

the number of rows and columns

◆ step

size_t cv::cann::AscendMat::step

a distance between successive rows in bytes; includes the gap if any


The documentation for this class was generated from the following file: