mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Merge pull request #145 from taka-no-me/vec_print
This commit is contained in:
commit
4d6bdc1533
@ -3873,10 +3873,21 @@ template<typename _Tp> inline std::ostream& operator<<(std::ostream& out, const
|
|||||||
template<typename _Tp, int n> inline std::ostream& operator<<(std::ostream& out, const Vec<_Tp, n>& vec)
|
template<typename _Tp, int n> inline std::ostream& operator<<(std::ostream& out, const Vec<_Tp, n>& vec)
|
||||||
{
|
{
|
||||||
out << "[";
|
out << "[";
|
||||||
for (int i = 0; i < n - 1; ++i) {
|
|
||||||
out << vec[i] << ", ";
|
if(Vec<_Tp, n>::depth < CV_32F)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < n - 1; ++i) {
|
||||||
|
out << (int)vec[i] << ", ";
|
||||||
|
}
|
||||||
|
out << (int)vec[n-1] << "]";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 0; i < n - 1; ++i) {
|
||||||
|
out << vec[i] << ", ";
|
||||||
|
}
|
||||||
|
out << vec[n-1] << "]";
|
||||||
}
|
}
|
||||||
out << vec[n-1] << "]";
|
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user