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
76eb3897
Commit
76eb3897
authored
6 years ago
by
pasbi
Committed by
Alexander Alekhin
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #12240 from pasbi:pfm_fix
* fixed 64-float pfm auto conversion * removed trailing whitespace
parent
e9a1ccb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
grfmt_pfm.cpp
modules/imgcodecs/src/grfmt_pfm.cpp
+5
-3
No files found.
modules/imgcodecs/src/grfmt_pfm.cpp
View file @
76eb3897
...
...
@@ -185,7 +185,9 @@ PFMEncoder::~PFMEncoder()
bool
PFMEncoder
::
isFormatSupported
(
int
depth
)
const
{
return
CV_MAT_DEPTH
(
depth
)
==
CV_32F
||
CV_MAT_DEPTH
(
depth
)
==
CV_8U
;
// any depth will be converted into 32-bit float.
(
void
)
depth
;
return
true
;
}
bool
PFMEncoder
::
write
(
const
Mat
&
img
,
const
std
::
vector
<
int
>&
params
)
...
...
@@ -246,8 +248,8 @@ bool PFMEncoder::write(const Mat& img, const std::vector<int>& params)
rgb_row
[
x
*
3
+
1
]
=
bgr_row
[
x
*
3
+
1
];
rgb_row
[
x
*
3
+
2
]
=
bgr_row
[
x
*
3
+
0
];
}
strm
.
putBytes
(
reinterpret_cast
<
const
uchar
*>
(
rgb_row
.
data
()),
static_cast
<
int
>
(
sizeof
(
float
)
*
row_size
)
);
strm
.
putBytes
(
reinterpret_cast
<
const
uchar
*>
(
rgb_row
.
data
()),
static_cast
<
int
>
(
sizeof
(
float
)
*
row_size
)
);
}
else
if
(
float_img
.
channels
()
==
1
)
{
strm
.
putBytes
(
float_img
.
ptr
(
y
),
sizeof
(
float
)
*
float_img
.
cols
);
}
...
...
This diff is collapsed.
Click to expand it.
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