mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
51 lines
1.2 KiB
Java
51 lines
1.2 KiB
Java
/* ----------------------------------------------------------------------------
|
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
|
* Version 1.3.40
|
|
*
|
|
* Do not make changes to this file unless you know what you are doing--modify
|
|
* the SWIG interface file instead.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
package com.opencv.jni;
|
|
|
|
/** Wrapper for the OpenCV Mat object. Good for passing around as a pointer to a Mat.
|
|
*/
|
|
public class Mat {
|
|
private long swigCPtr;
|
|
protected boolean swigCMemOwn;
|
|
public Mat(long cPtr, boolean cMemoryOwn) {
|
|
swigCMemOwn = cMemoryOwn;
|
|
swigCPtr = cPtr;
|
|
}
|
|
public static long getCPtr(Mat obj) {
|
|
return (obj == null) ? 0 : obj.swigCPtr;
|
|
}
|
|
|
|
protected void finalize() {
|
|
delete();
|
|
}
|
|
|
|
public synchronized void delete() {
|
|
if (swigCPtr != 0) {
|
|
if (swigCMemOwn) {
|
|
swigCMemOwn = false;
|
|
opencvJNI.delete_Mat(swigCPtr);
|
|
}
|
|
swigCPtr = 0;
|
|
}
|
|
}
|
|
|
|
public int getRows() {
|
|
return opencvJNI.Mat_rows_get(swigCPtr, this);
|
|
}
|
|
|
|
public int getCols() {
|
|
return opencvJNI.Mat_cols_get(swigCPtr, this);
|
|
}
|
|
|
|
public Mat() {
|
|
this(opencvJNI.new_Mat(), true);
|
|
}
|
|
|
|
}
|