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
2aafd31e
Commit
2aafd31e
authored
22 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
remove unused vars and fix compile with old versions of libpng
parent
cc53e44a
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/gl2png.cpp
+5
-7
5 additions, 7 deletions
Graphics/gl2png.cpp
with
5 additions
and
7 deletions
Graphics/gl2png.cpp
+
5
−
7
View file @
2aafd31e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* GL2PNG, an OpenGL to PNG Printing Library
* GL2PNG, an OpenGL to PNG Printing Library
* Copyright (C) 2003 Christophe Geuzaine
* Copyright (C) 2003 Christophe Geuzaine
*
*
* $Id: gl2png.cpp,v 1.
2
2003-04-0
2 06:02:01
geuzaine Exp $
* $Id: gl2png.cpp,v 1.
3
2003-04-0
4 02:37:47
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
...
@@ -53,8 +53,6 @@ void create_png(FILE * file, int width, int height, int quality)
...
@@ -53,8 +53,6 @@ void create_png(FILE * file, int width, int height, int quality)
png_infop
info_ptr
;
png_infop
info_ptr
;
png_text
text_ptr
[
10
];
png_text
text_ptr
[
10
];
unsigned
char
*
pixels
;
unsigned
char
*
pixels
;
png_byte
image
[
height
][
width
*
3
];
png_bytep
row_pointers
[
height
];
time_t
now
;
time_t
now
;
time
(
&
now
);
time
(
&
now
);
...
@@ -69,7 +67,7 @@ void create_png(FILE * file, int width, int height, int quality)
...
@@ -69,7 +67,7 @@ void create_png(FILE * file, int width, int height, int quality)
info_ptr
=
png_create_info_struct
(
png_ptr
);
info_ptr
=
png_create_info_struct
(
png_ptr
);
if
(
info_ptr
==
NULL
)
{
if
(
info_ptr
==
NULL
)
{
png_destroy_write_struct
(
&
png_ptr
,
png_infopp_
NULL
);
png_destroy_write_struct
(
&
png_ptr
,
NULL
);
Msg
(
GERROR
,
"Could not create PNG info struct"
);
Msg
(
GERROR
,
"Could not create PNG info struct"
);
return
;
return
;
}
}
...
@@ -82,7 +80,7 @@ void create_png(FILE * file, int width, int height, int quality)
...
@@ -82,7 +80,7 @@ void create_png(FILE * file, int width, int height, int quality)
png_init_io
(
png_ptr
,
file
);
png_init_io
(
png_ptr
,
file
);
png_set_compression_level
(
png_ptr
,
compression_level
);
png_set_compression_level
(
png_ptr
,
compression_level
);
png_set_IHDR
(
png_ptr
,
info_ptr
,
width
,
height
,
8
,
PNG_COLOR_TYPE_RGB
,
png_set_IHDR
(
png_ptr
,
info_ptr
,
width
,
height
,
8
,
PNG_COLOR_TYPE_RGB
,
PNG_INTERLACE_NONE
,
PNG_COMPRESSION_TYPE_BASE
,
PNG_FILTER_TYPE_BASE
);
PNG_INTERLACE_NONE
,
PNG_COMPRESSION_TYPE_BASE
,
PNG_FILTER_TYPE_BASE
);
...
@@ -99,8 +97,8 @@ void create_png(FILE * file, int width, int height, int quality)
...
@@ -99,8 +97,8 @@ void create_png(FILE * file, int width, int height, int quality)
glPixelStorei
(
GL_PACK_ALIGNMENT
,
1
);
glPixelStorei
(
GL_PACK_ALIGNMENT
,
1
);
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
pixels
=
(
unsigned
char
*
)
Malloc
(
width
*
3
*
sizeof
(
unsigned
char
));
pixels
=
(
unsigned
char
*
)
Malloc
(
width
*
3
*
sizeof
(
unsigned
char
));
for
(
row
=
height
-
1
;
row
>=
0
;
row
--
)
{
for
(
row
=
height
-
1
;
row
>=
0
;
row
--
)
{
glReadPixels
(
0
,
row
,
width
,
1
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
pixels
);
glReadPixels
(
0
,
row
,
width
,
1
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
pixels
);
png_write_row
(
png_ptr
,
(
png_bytep
)
pixels
);
png_write_row
(
png_ptr
,
(
png_bytep
)
pixels
);
}
}
...
...
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