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
1b22783d
Commit
1b22783d
authored
Jun 26, 2016
by
Suleyman TURKMEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update grfmt_png.cpp
parent
0e436c3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
grfmt_png.cpp
modules/imgcodecs/src/grfmt_png.cpp
+5
-4
No files found.
modules/imgcodecs/src/grfmt_png.cpp
View file @
1b22783d
...
...
@@ -370,22 +370,23 @@ bool PngEncoder::write( const Mat& img, const std::vector<int>& params )
}
int
compression_level
=
-
1
;
// Invalid value to allow setting 0-9 as valid
int
compression_strategy
=
Z
_RLE
;
// Default strategy
int
compression_strategy
=
IMWRITE_PNG_STRATEGY
_RLE
;
// Default strategy
bool
isBilevel
=
false
;
for
(
size_t
i
=
0
;
i
<
params
.
size
();
i
+=
2
)
{
if
(
params
[
i
]
==
CV_
IMWRITE_PNG_COMPRESSION
)
if
(
params
[
i
]
==
IMWRITE_PNG_COMPRESSION
)
{
compression_strategy
=
IMWRITE_PNG_STRATEGY_DEFAULT
;
// Default strategy
compression_level
=
params
[
i
+
1
];
compression_level
=
MIN
(
MAX
(
compression_level
,
0
),
Z_BEST_COMPRESSION
);
}
if
(
params
[
i
]
==
CV_
IMWRITE_PNG_STRATEGY
)
if
(
params
[
i
]
==
IMWRITE_PNG_STRATEGY
)
{
compression_strategy
=
params
[
i
+
1
];
compression_strategy
=
MIN
(
MAX
(
compression_strategy
,
0
),
Z_FIXED
);
}
if
(
params
[
i
]
==
CV_
IMWRITE_PNG_BILEVEL
)
if
(
params
[
i
]
==
IMWRITE_PNG_BILEVEL
)
{
isBilevel
=
params
[
i
+
1
]
!=
0
;
}
...
...
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