Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
fff5a3b7
Commit
fff5a3b7
authored
Oct 13, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defined the jpeg quality measure.
parent
264c2b6d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
save_jpeg.cpp
dlib/image_saver/save_jpeg.cpp
+11
-0
save_jpeg_abstract.h
dlib/image_saver/save_jpeg_abstract.h
+3
-0
No files found.
dlib/image_saver/save_jpeg.cpp
View file @
fff5a3b7
...
...
@@ -48,6 +48,11 @@ namespace dlib
"
\t
save_jpeg()"
<<
"
\n\t
You can't save an empty image as a JPEG."
);
DLIB_CASSERT
(
0
<=
quality
&&
quality
<=
100
,
"
\t
save_jpeg()"
<<
"
\n\t
Invalid quality value."
<<
"
\n\t
quality: "
<<
quality
);
FILE
*
outfile
=
fopen
(
filename
.
c_str
(),
"wb"
);
if
(
!
outfile
)
...
...
@@ -104,6 +109,12 @@ namespace dlib
"
\t
save_jpeg()"
<<
"
\n\t
You can't save an empty image as a JPEG."
);
DLIB_CASSERT
(
0
<=
quality
&&
quality
<=
100
,
"
\t
save_jpeg()"
<<
"
\n\t
Invalid quality value."
<<
"
\n\t
quality: "
<<
quality
);
FILE
*
outfile
=
fopen
(
filename
.
c_str
(),
"wb"
);
if
(
!
outfile
)
...
...
dlib/image_saver/save_jpeg_abstract.h
View file @
fff5a3b7
...
...
@@ -25,6 +25,7 @@ namespace dlib
- image_type == an image object that implements the interface defined in
dlib/image_processing/generic_image.h or a matrix expression
- image.size() != 0
- 0 <= quality <= 100
ensures
- writes the image to the file indicated by file_name in the JPEG format.
- image[0][0] will be in the upper left corner of the image.
...
...
@@ -34,6 +35,8 @@ namespace dlib
save_jpeg() can only natively store rgb_pixel and uint8 pixel types. All
other pixel types will be converted into one of these types as appropriate
before being saved to disk.
- The quality value determines how lossy the compression is. Larger quality
values result in larger output images but the images will look better.
throws
- image_save_error
This exception is thrown if there is an error that prevents us from saving
...
...
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