45 static bool PyDateTime_CheckExt(PyObject* obj);
48 static bool PyTimeDelta_CheckExt(PyObject* obj);
50 static DateTime GetDateTime(PyObject* obj,
bool& ok);
51 static TimeDelta GetTimeDelta(PyObject* obj,
bool& ok);
54 static PyObject* GetPyDateTime(
const DateTime& datetime);
57 static PyObject* GetPyTimeDelta(
const TimeDelta& delta);
59 static bool ItoDatetime2npyDatetime(
60 const ito::DateTime& src, npy_datetime& dest,
const PyArray_DatetimeMetaData& meta);
62 static bool NpyDatetime2itoDatetime(
63 const npy_datetime& dt,
const PyArray_DatetimeMetaData &md,
ito::DateTime& out);
65 static bool ItoTimedelta2npyTimedleta(
66 const ito::TimeDelta& src, npy_timedelta& dest,
const PyArray_DatetimeMetaData& meta);
68 static bool NpyTimedelta2itoTimedelta(
69 const npy_timedelta& dt,
const PyArray_DatetimeMetaData &md,
ito::TimeDelta& out);
71 template <
typename _Tp,
size_t timeMemberOffset>
72 static void GuessDateTimeMetaFromDataObjectValues(
75 ito::int64 combined = 0LL;
87 for (
int r = 0; r < plane->rows; ++r)
89 rowPtr = plane->ptr<_Tp>(r);
91 for (
int c = 0; c < plane->cols; ++c)
93 item =
reinterpret_cast<const uchar*
>(&(rowPtr[c]));
95 combined |= *
reinterpret_cast<const ito::int64*
>(item + timeMemberOffset);
103 descr_meta.base = NPY_FR_us;
105 if (combined % 1000LL == 0)
108 if (combined % 1000000LL == 0)
111 if (combined % 1000000000LL == 0)
114 if (combined % (60LL * 1000000000LL) == 0)
117 if (combined % (3600LL * 1000000000LL) == 0)
120 descr_meta.base = NPY_FR_D;
124 descr_meta.base = NPY_FR_h;
129 descr_meta.base = NPY_FR_m;
134 descr_meta.base = NPY_FR_s;
139 descr_meta.base = NPY_FR_ms;
144 descr_meta.base = NPY_FR_us;
cv::Mat * getCvPlaneMat(const int planeIndex)
returns pointer to cv::Mat plane with given index considering a possible roi.
Definition dataobj.cpp:1317