| 181 | public: |
| 182 | virtual ~NumpyFormatter() {} |
| 183 | void write(std::ostream& out, const Mat& m, const int*, int) const |
| 184 | { |
| 185 | static const char* numpyTypes[] = |
| 186 | { |
| 187 | "uint8", "int8", "uint16", "int16", "int32", "float32", "float64", "uint64" |
| 188 | }; |
| 189 | out << "array(["; |
| 190 | writeMat(out, m, m.cols > 1 ? '[' : ' ', '[', m.rows*m.channels() == 1); |
| 191 | out << "], type='" << numpyTypes[m.depth()] << "')"; |
| 192 | } |
| 193 | |
| 194 | void write(std::ostream& out, const void* data, int nelems, int type, const int*, int) const |
| 195 | { |
nothing calls this directly
no test coverage detected