Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
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
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iwr
amdis
Commits
7c6dd8a4
Commit
7c6dd8a4
authored
13 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
PngReader implemented
parent
74f06100
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMDiS/src/io/PngReader.cc
+14
-16
14 additions, 16 deletions
AMDiS/src/io/PngReader.cc
AMDiS/src/io/PngReader.h
+3
-2
3 additions, 2 deletions
AMDiS/src/io/PngReader.h
with
17 additions
and
18 deletions
AMDiS/src/io/PngReader.cc
+
14
−
16
View file @
7c6dd8a4
...
...
@@ -29,23 +29,27 @@ namespace AMDiS {
png_infop
info_ptr
;
FILE
*
fp
;
unsigned
int
sig_read
=
0
;
int
row
,
col
,
nVertices
,
nElements
;
int
row
,
col
;
int
bytesPerPixel
=
0
;
// Open files and create the png data structures.
if
((
fp
=
fopen
(
filename
.
c_str
(),
"rb"
))
==
NULL
)
TEST_EXIT
(
0
)(
"ERROR: file can not be opened
\n
"
);
if
((
fp
=
fopen
(
filename
.
c_str
(),
"rb"
))
==
NULL
)
{
TEST_EXIT
(
0
)(
"ERROR: file can not >be opened
\n
"
);
}
png_ptr
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
NULL
,
NULL
,
NULL
);
if
(
png_ptr
==
NULL
)
if
(
png_ptr
==
NULL
)
{
TEST_EXIT
(
0
)(
"ERROR in png_create_read_struct
\n
"
);
}
info_ptr
=
png_create_info_struct
(
png_ptr
);
if
(
info_ptr
==
NULL
)
if
(
info_ptr
==
NULL
)
{
TEST_EXIT
(
0
)(
"ERROR in png_create_info_struct
\n
"
);
}
if
(
setjmp
(
png_jmpbuf
(
png_ptr
)))
if
(
setjmp
(
png_jmpbuf
(
png_ptr
)))
{
TEST_EXIT
(
0
)(
"ERROR in png_jmpbuf
\n
"
);
}
png_init_io
(
png_ptr
,
fp
);
png_set_sig_bytes
(
png_ptr
,
sig_read
);
...
...
@@ -60,10 +64,6 @@ namespace AMDiS {
cout
<<
"Bytes per pixel: "
<<
bytesPerPixel
<<
endl
;
double
value
=
0
;
const
DOFAdmin
*
admin
=
vec
->
getFeSpace
()
->
getAdmin
();
int
n0
=
admin
->
getNumberOfPreDofs
(
VERTEX
);
//offset zum globale DOF-managment
int
dim
=
vec
->
getFeSpace
()
->
getMesh
()
->
getDim
();
int
dow
=
Global
::
getGeo
(
WORLD
);
const
BasisFunction
*
basFcts
=
vec
->
getFeSpace
()
->
getBasisFcts
();
int
numBasFcts
=
basFcts
->
getNumber
();
DegreeOfFreedom
*
localIndices
=
new
DegreeOfFreedom
[
numBasFcts
];
...
...
@@ -76,7 +76,6 @@ namespace AMDiS {
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
);
while
(
elInfo
)
{
const
DegreeOfFreedom
**
dof
=
elInfo
->
getElement
()
->
getDof
();
Element
*
el
=
elInfo
->
getElement
();
basFcts
->
getLocalIndices
(
el
,
vec
->
getFeSpace
()
->
getAdmin
(),
localIndices
);
...
...
@@ -96,7 +95,7 @@ namespace AMDiS {
static_cast
<
double
>
(
info_ptr
->
row_pointers
[
row
][
col
*
3
+
2
]));
break
;
default:
TEST_EXIT
(
false
)(
"ERROR: bytesPerPixel=%d is unknown case!
\n
"
,
bytesPerPixel
)
TEST_EXIT
(
false
)(
"ERROR: bytesPerPixel=%d is unknown case!
\n
"
,
bytesPerPixel
)
;
}
(
*
vec
)[
localIndices
[
i
]]
=
value
;
}
...
...
@@ -107,7 +106,6 @@ namespace AMDiS {
png_destroy_read_struct
(
&
png_ptr
,
&
info_ptr
,
NULL
);
fclose
(
fp
);
return
(
0
);
}
}
};
};
This diff is collapsed.
Click to expand it.
AMDiS/src/io/PngReader.h
+
3
−
2
View file @
7c6dd8a4
...
...
@@ -20,8 +20,8 @@
/** \file ValueReader.h */
#ifndef AMDIS_
VALUE
READER_H
#define AMDIS_
VALUE
READER_H
#ifndef AMDIS_
PNG
READER_H
#define AMDIS_
PNG
READER_H
#include
"AMDiS.h"
...
...
@@ -63,6 +63,7 @@ namespace AMDiS {
yMin
=
minDim
[
1
];
yMax
=
maxDim
[
1
];
};
};
}
#endif
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