Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
b7266209
Commit
b7266209
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
typos
parent
28d0d582
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graphics/gl2jpeg.cpp
+6
-11
6 additions, 11 deletions
Graphics/gl2jpeg.cpp
with
6 additions
and
11 deletions
Graphics/gl2jpeg.cpp
+
6
−
11
View file @
b7266209
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* GL2JPEG, an OpenGL to JPEG Printing Library
* GL2JPEG, an OpenGL to JPEG Printing Library
* Copyright (C) 1999-2002 Christophe Geuzaine
* Copyright (C) 1999-2002 Christophe Geuzaine
*
*
* $Id: gl2jpeg.cpp,v 1.
9
2002-05-1
8 07:56:48
geuzaine Exp $
* $Id: gl2jpeg.cpp,v 1.
10
2002-05-1
9 19:36:00
geuzaine Exp $
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* modify it under the terms of the GNU Library General Public
...
@@ -39,18 +39,18 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
...
@@ -39,18 +39,18 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
unsigned
char
*
pixels
;
unsigned
char
*
pixels
;
struct
jpeg_compress_struct
cinfo
;
struct
jpeg_compress_struct
cinfo
;
struct
jpeg_error_mgr
jerr
;
struct
jpeg_error_mgr
jerr
;
JSAMPROW
row_pointer
[
1
];
// pointer to JSAMPLE row[s]
JSAMPROW
row_pointer
[
1
];
int
row_stride
;
// physical row width in image buffer
int
row_stride
;
cinfo
.
err
=
jpeg_std_error
(
&
jerr
);
cinfo
.
err
=
jpeg_std_error
(
&
jerr
);
cinfo
.
err
->
output_message
=
my_output_message
;
cinfo
.
err
->
output_message
=
my_output_message
;
jpeg_create_compress
(
&
cinfo
);
jpeg_create_compress
(
&
cinfo
);
jpeg_stdio_dest
(
&
cinfo
,
outfile
);
jpeg_stdio_dest
(
&
cinfo
,
outfile
);
cinfo
.
image_width
=
width
;
//
image width and height,
in pixels
cinfo
.
image_width
=
width
;
// in pixels
cinfo
.
image_height
=
height
;
cinfo
.
image_height
=
height
;
cinfo
.
input_components
=
3
;
//
# of
color components per pixel
cinfo
.
input_components
=
3
;
//
3
color components per pixel
cinfo
.
in_color_space
=
JCS_RGB
;
// colorspace of input image
cinfo
.
in_color_space
=
JCS_RGB
;
jpeg_set_defaults
(
&
cinfo
);
jpeg_set_defaults
(
&
cinfo
);
jpeg_set_quality
(
&
cinfo
,
quality
,
TRUE
);
jpeg_set_quality
(
&
cinfo
,
quality
,
TRUE
);
jpeg_start_compress
(
&
cinfo
,
TRUE
);
jpeg_start_compress
(
&
cinfo
,
TRUE
);
...
@@ -63,11 +63,6 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
...
@@ -63,11 +63,6 @@ void create_jpeg(FILE *outfile, int width, int height, int quality){
row_stride
=
width
*
3
;
row_stride
=
width
*
3
;
i
=
cinfo
.
image_height
-
1
;
i
=
cinfo
.
image_height
-
1
;
while
(
i
>=
0
)
{
while
(
i
>=
0
)
{
/*
jpeg_write_scanlines expects an array of pointers to scanlines.
Here the array is only one element long, but you could pass
more than one scanline at a time if that's more convenient.
*/
row_pointer
[
0
]
=
&
pixels
[
i
*
row_stride
];
row_pointer
[
0
]
=
&
pixels
[
i
*
row_stride
];
(
void
)
jpeg_write_scanlines
(
&
cinfo
,
row_pointer
,
1
);
(
void
)
jpeg_write_scanlines
(
&
cinfo
,
row_pointer
,
1
);
i
--
;
i
--
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment