Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
81c5d580
Commit
81c5d580
authored
Apr 14, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3928 from ilya-lavrenov:android_4.6
parents
b6393531
17bedd72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
25 deletions
+21
-25
out.cpp
modules/core/src/out.cpp
+21
-25
No files found.
modules/core/src/out.cpp
View file @
81c5d580
...
...
@@ -43,9 +43,9 @@
#include "precomp.hpp"
namespace
namespace
cv
{
class
FormattedImpl
:
public
cv
::
Formatted
class
FormattedImpl
:
public
Formatted
{
enum
{
STATE_PROLOGUE
,
STATE_EPILOGUE
,
STATE_INTERLUDE
,
STATE_ROW_OPEN
,
STATE_ROW_CLOSE
,
STATE_CN_OPEN
,
STATE_CN_CLOSE
,
STATE_VALUE
,
STATE_FINISHED
,
...
...
@@ -55,7 +55,7 @@ namespace
char
floatFormat
[
8
];
char
buf
[
32
];
// enough for double with precision up to 20
cv
::
Mat
mtx
;
Mat
mtx
;
int
mcn
;
// == mtx.channels()
bool
singleLine
;
bool
alignOrder
;
// true when cn first order
...
...
@@ -65,8 +65,8 @@ namespace
int
col
;
int
cn
;
cv
::
String
prologue
;
cv
::
String
epilogue
;
String
prologue
;
String
epilogue
;
char
braces
[
5
];
void
(
FormattedImpl
::*
valueToStr
)();
...
...
@@ -81,7 +81,7 @@ namespace
public
:
FormattedImpl
(
cv
::
String
pl
,
cv
::
String
el
,
cv
::
Mat
m
,
char
br
[
5
],
bool
sLine
,
bool
aOrder
,
int
precision
)
FormattedImpl
(
String
pl
,
String
el
,
Mat
m
,
char
br
[
5
],
bool
sLine
,
bool
aOrder
,
int
precision
)
{
CV_Assert
(
m
.
dims
<=
2
);
...
...
@@ -253,7 +253,7 @@ namespace
}
};
class
FormatterBase
:
public
cv
::
Formatter
class
FormatterBase
:
public
Formatter
{
public
:
FormatterBase
()
:
prec32f
(
8
),
prec64f
(
16
),
multiline
(
true
)
{}
...
...
@@ -278,14 +278,15 @@ namespace
int
prec64f
;
int
multiline
;
};
class
DefaultFormatter
:
public
FormatterBase
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
char
braces
[
5
]
=
{
'\0'
,
'\0'
,
';'
,
'\0'
,
'\0'
};
return
cv
::
makePtr
<
FormattedImpl
>
(
"["
,
"]"
,
mtx
,
&*
braces
,
return
makePtr
<
FormattedImpl
>
(
"["
,
"]"
,
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
false
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
};
...
...
@@ -294,10 +295,10 @@ namespace
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
char
braces
[
5
]
=
{
'\0'
,
'\0'
,
';'
,
'\0'
,
'\0'
};
return
cv
::
makePtr
<
FormattedImpl
>
(
""
,
""
,
mtx
,
&*
braces
,
return
makePtr
<
FormattedImpl
>
(
""
,
""
,
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
true
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
};
...
...
@@ -306,12 +307,12 @@ namespace
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
char
braces
[
5
]
=
{
'['
,
']'
,
'\0'
,
'['
,
']'
};
if
(
mtx
.
cols
==
1
)
braces
[
0
]
=
braces
[
1
]
=
'\0'
;
return
cv
::
makePtr
<
FormattedImpl
>
(
"["
,
"]"
,
mtx
,
&*
braces
,
return
makePtr
<
FormattedImpl
>
(
"["
,
"]"
,
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
false
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
};
...
...
@@ -320,7 +321,7 @@ namespace
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
static
const
char
*
numpyTypes
[]
=
{
...
...
@@ -329,7 +330,7 @@ namespace
char
braces
[
5
]
=
{
'['
,
']'
,
'\0'
,
'['
,
']'
};
if
(
mtx
.
cols
==
1
)
braces
[
0
]
=
braces
[
1
]
=
'\0'
;
return
cv
::
makePtr
<
FormattedImpl
>
(
"array(["
,
return
makePtr
<
FormattedImpl
>
(
"array(["
,
cv
::
format
(
"], type='%s')"
,
numpyTypes
[
mtx
.
depth
()]),
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
false
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
...
...
@@ -339,11 +340,11 @@ namespace
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
char
braces
[
5
]
=
{
'\0'
,
'\0'
,
'\0'
,
'\0'
,
'\0'
};
return
cv
::
makePtr
<
FormattedImpl
>
(
cv
::
String
(),
mtx
.
rows
>
1
?
cv
::
String
(
"
\n
"
)
:
cv
::
String
(),
mtx
,
&*
braces
,
return
makePtr
<
FormattedImpl
>
(
String
(),
mtx
.
rows
>
1
?
String
(
"
\n
"
)
:
String
(),
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
false
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
};
...
...
@@ -352,19 +353,14 @@ namespace
{
public
:
cv
::
Ptr
<
cv
::
Formatted
>
format
(
const
cv
::
Mat
&
mtx
)
const
Ptr
<
Formatted
>
format
(
const
Mat
&
mtx
)
const
{
char
braces
[
5
]
=
{
'\0'
,
'\0'
,
','
,
'\0'
,
'\0'
};
return
cv
::
makePtr
<
FormattedImpl
>
(
"{"
,
"}"
,
mtx
,
&*
braces
,
return
makePtr
<
FormattedImpl
>
(
"{"
,
"}"
,
mtx
,
&*
braces
,
mtx
.
rows
==
1
||
!
multiline
,
false
,
mtx
.
depth
()
==
CV_64F
?
prec64f
:
prec32f
);
}
};
}
// namespace
namespace
cv
{
Formatted
::~
Formatted
()
{}
Formatter
::~
Formatter
()
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment