Update to 2.0.0 tree from current Fremantle build
[opencv] / interfaces / swig / python / pyhelpers.h
index 668ddf6..4048bf5 100644 (file)
@@ -8,10 +8,19 @@
 /** convert python index object (tuple, integer, or slice) to CvRect for subsequent cvGetSubMat call */
 CvRect PySlice_to_CvRect(CvArr * src, PyObject * idx_object);
 
+/** 1 if rectangle is a subrectangle of [0,0,w,h], 0 otherwise */
+int CheckSliceBounds(CvRect * rect, int w, int h );
+
+/// convert object that supports the array protocol to CvMat *
+CvArr * PyArray_to_CvArr (PyObject * obj);
+
+/// convert nested sequences to CvMat *
+CvArr * PySequence_to_CvArr (PyObject * obj);
+
 /** prints array to stdout 
  *  TODO: python __str__ and __repr__ return strings, so this should write to a string 
  */
-void cvArrPrint( CvArr * mat );
+void cvArrPrint (CvArr * mat);
 
 /** Convert an integer array to python tuple */
 PyObject * PyTuple_FromIntArray(int * arr, int len);
@@ -30,4 +39,6 @@ int PyObject_AsDoubleArray(PyObject * obj, double * array, int len);
 int PyObject_AsLongArray(  PyObject * obj, int * array, int len);
 int PyObject_AsFloatArray(PyObject * obj, float * array, int len);
 
+static inline int cvCvToIplDepth(int type) { return cvIplDepth(type); }
+
 #endif //PYHELPERS_H