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
ecf359b8
Commit
ecf359b8
authored
Dec 29, 2014
by
Ashod Nakashian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for multipage decoding in BaseImageDecoder and implemented in TiffDecoder.
parent
6cb93445
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
grfmt_base.hpp
modules/imgcodecs/src/grfmt_base.hpp
+3
-0
grfmt_tiff.cpp
modules/imgcodecs/src/grfmt_tiff.cpp
+14
-5
grfmt_tiff.hpp
modules/imgcodecs/src/grfmt_tiff.hpp
+1
-0
No files found.
modules/imgcodecs/src/grfmt_base.hpp
View file @
ecf359b8
...
...
@@ -70,6 +70,9 @@ public:
virtual
bool
readHeader
()
=
0
;
virtual
bool
readData
(
Mat
&
img
)
=
0
;
/// Called after readData to advance to the next page, if any.
virtual
bool
nextPage
()
{
return
false
;
}
virtual
size_t
signatureLength
()
const
;
virtual
bool
checkSignature
(
const
String
&
signature
)
const
;
virtual
ImageDecoder
newDecoder
()
const
;
...
...
modules/imgcodecs/src/grfmt_tiff.cpp
View file @
ecf359b8
...
...
@@ -118,10 +118,13 @@ bool TiffDecoder::readHeader()
{
bool
result
=
false
;
close
();
// TIFFOpen() mode flags are different to fopen(). A 'b' in mode "rb" has no effect when reading.
// http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
TIFF
*
tif
=
TIFFOpen
(
m_filename
.
c_str
(),
"r"
);
TIFF
*
tif
=
static_cast
<
TIFF
*>
(
m_tif
);
if
(
!
m_tif
)
{
// TIFFOpen() mode flags are different to fopen(). A 'b' in mode "rb" has no effect when reading.
// http://www.remotesensing.org/libtiff/man/TIFFOpen.3tiff.html
tif
=
TIFFOpen
(
m_filename
.
c_str
(),
"r"
);
}
if
(
tif
)
{
...
...
@@ -182,6 +185,13 @@ bool TiffDecoder::readHeader()
return
result
;
}
bool
TiffDecoder
::
nextPage
()
{
// Prepare the next page, if any.
return
m_tif
&&
TIFFReadDirectory
(
static_cast
<
TIFF
*>
(
m_tif
))
&&
readHeader
();
}
bool
TiffDecoder
::
readData
(
Mat
&
img
)
{
...
...
@@ -413,7 +423,6 @@ bool TiffDecoder::readData( Mat& img )
}
}
close
();
return
result
;
}
...
...
modules/imgcodecs/src/grfmt_tiff.hpp
View file @
ecf359b8
...
...
@@ -100,6 +100,7 @@ public:
bool
readHeader
();
bool
readData
(
Mat
&
img
);
void
close
();
bool
nextPage
();
size_t
signatureLength
()
const
;
bool
checkSignature
(
const
String
&
signature
)
const
;
...
...
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