mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
%typemap(javaimports) Mat " |
|
/** Wrapper for the OpenCV Mat object. Good for passing around as a pointer to a Mat. |
|
*/" |
|
|
|
%typemap(javaimports) Size " |
|
/** Wrapper for the OpenCV Size object. Good for setting dimensions of cv::Mat... |
|
*/" |
|
|
|
class Mat { |
|
public: |
|
%immutable; |
|
int rows; |
|
int cols; |
|
}; |
|
|
|
class Size{ |
|
public: |
|
Size(int width,int height); |
|
int width; |
|
int height; |
|
|
|
}; |
|
|
|
template<class _Tp> class Ptr |
|
{ |
|
public: |
|
//! empty constructor |
|
Ptr(); |
|
//! take ownership of the pointer. The associated reference counter is allocated and set to 1 |
|
Ptr(_Tp* _obj); |
|
//! calls release() |
|
~Ptr(); |
|
//! copy constructor. Copies the members and calls addref() |
|
Ptr(const Ptr& ptr); |
|
//! copy operator. Calls ptr.addref() and release() before copying the members |
|
// Ptr& operator = (const Ptr& ptr); |
|
//! increments the reference counter |
|
void addref(); |
|
//! decrements the reference counter. If it reaches 0, delete_obj() is called |
|
void release(); |
|
//! deletes the object. Override if needed |
|
void delete_obj(); |
|
//! returns true iff obj==NULL |
|
bool empty() const; |
|
|
|
|
|
//! helper operators making "Ptr<T> ptr" use very similar to "T* ptr". |
|
_Tp* operator -> (); |
|
// const _Tp* operator -> () const; |
|
|
|
// operator _Tp* (); |
|
// operator const _Tp*() const; |
|
|
|
protected: |
|
_Tp* obj; //< the object pointer. |
|
int* refcount; //< the associated reference counter |
|
}; |
|
|
|
%template(PtrMat) Ptr<Mat>; |