Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp_integrale_rivier
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
nicolas.rivier
tp_integrale_rivier
Commits
4095b411
Commit
4095b411
authored
2 years ago
by
Og
Browse files
Options
Downloads
Patches
Plain Diff
[fix] SDL IMAGE VIEWER FUCKKKKING WORKS git status git status
parent
18364a55
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+5
-2
5 additions, 2 deletions
Makefile
main.c
+4
-0
4 additions, 0 deletions
main.c
traitementPGM.c
+10
-0
10 additions, 0 deletions
traitementPGM.c
traitementPGM.h
+2
-0
2 additions, 0 deletions
traitementPGM.h
with
21 additions
and
2 deletions
Makefile
+
5
−
2
View file @
4095b411
...
@@ -2,7 +2,7 @@ CC = gcc
...
@@ -2,7 +2,7 @@ CC = gcc
CFLAGS
=
-std
=
gnu11
-Wall
-Wextra
-Wpedantic
-Wwrite-strings
-Walloc-zero
-Wparentheses
CFLAGS
=
-std
=
gnu11
-Wall
-Wextra
-Wpedantic
-Wwrite-strings
-Walloc-zero
-Wparentheses
CFLAGS
+=
-Wlarger-than
=
100000
-Wmissing-declarations
-Wmissing-include-dirs
-Wmissing-prototypes
-Wformat-overflow
=
2
-Wunused-parameter
CFLAGS
+=
-Wlarger-than
=
100000
-Wmissing-declarations
-Wmissing-include-dirs
-Wmissing-prototypes
-Wformat-overflow
=
2
-Wunused-parameter
CFLAGS
+=
-g
-pedantic
-fsanitize
=
address
-fsanitize
=
leak
-fsanitize
=
undefined
-Wdiscarded-qualifiers
CFLAGS
+=
-g
-pedantic
-fsanitize
=
address
-fsanitize
=
leak
-fsanitize
=
undefined
-Wdiscarded-qualifiers
LDFLAGS
=
-lm
LDFLAGS
=
-lm
-lSDL2main
-lSDL2_image
-lSDL2
############# COMMAND HELP #############
############# COMMAND HELP #############
...
@@ -21,7 +21,7 @@ LDFLAGS = -lm
...
@@ -21,7 +21,7 @@ LDFLAGS = -lm
PROG
=
Exe
PROG
=
Exe
$(PROG)
:
Matrix.o math_lib.o traitementPGM.o main.c
$(PROG)
:
Matrix.o math_lib.o traitementPGM.o
gfx.o
main.c
$(
CC
)
-o
$@
$^
$(
CFLAGS
)
$(
LDFLAGS
)
$(
CC
)
-o
$@
$^
$(
CFLAGS
)
$(
LDFLAGS
)
math_lib.o
:
math_lib.c
math_lib.o
:
math_lib.c
...
@@ -33,6 +33,9 @@ Matrix.o: Matrix.c
...
@@ -33,6 +33,9 @@ Matrix.o: Matrix.c
traitementPGM.o
:
traitementPGM.c
traitementPGM.o
:
traitementPGM.c
$(
CC
)
-c
$^
$(
CFLAGS
)
$(
LDFLAGS
)
$(
CC
)
-c
$^
$(
CFLAGS
)
$(
LDFLAGS
)
gfx.o
:
gfx.c
$(
CC
)
-c
$^
$(
CFLAGS
)
$(
LDFLAGS
)
rapport
:
rapport.md
rapport
:
rapport.md
pandoc
-s
$<
-o
$@
.pdf
--template
eisvogel.latex
--listings
--pdf-engine
pdflatex
pandoc
-s
$<
-o
$@
.pdf
--template
eisvogel.latex
--listings
--pdf-engine
pdflatex
...
...
This diff is collapsed.
Click to expand it.
main.c
+
4
−
0
View file @
4095b411
...
@@ -45,6 +45,8 @@ void Convolution_filtrage()
...
@@ -45,6 +45,8 @@ void Convolution_filtrage()
char
output_image
[]
=
"out.pgm"
;
char
output_image
[]
=
"out.pgm"
;
char
output_convolve
[]
=
"convolve.pgm"
;
char
output_convolve
[]
=
"convolve.pgm"
;
char
sdl_name
[]
=
"convolution"
;
pgm
img
;
pgm
img
;
if
(
pgm_read_from_file
(
&
img
,
filname
)
==
-
1
)
if
(
pgm_read_from_file
(
&
img
,
filname
)
==
-
1
)
{
{
...
@@ -77,6 +79,8 @@ void Convolution_filtrage()
...
@@ -77,6 +79,8 @@ void Convolution_filtrage()
normalise_matrix
(
&
res
.
pixels
,
norm_min
,
norm_max
,
res
.
max
);
normalise_matrix
(
&
res
.
pixels
,
norm_min
,
norm_max
,
res
.
max
);
PrintImagePGM
(
res
,
sdl_name
);
pgm_write_to_file
(
&
res
,
output_convolve
);
pgm_write_to_file
(
&
res
,
output_convolve
);
matrix_free
(
&
img
.
pixels
);
matrix_free
(
&
img
.
pixels
);
...
...
This diff is collapsed.
Click to expand it.
traitementPGM.c
+
10
−
0
View file @
4095b411
...
@@ -48,4 +48,14 @@ void pgm_write_to_file(pgm *p, char *filename)
...
@@ -48,4 +48,14 @@ void pgm_write_to_file(pgm *p, char *filename)
}
}
fclose
(
f
);
fclose
(
f
);
}
void
PrintImagePGM
(
pgm
img
,
char
*
filname
)
{
printf
(
"Image sélectionnée '%s' de taille %dx%d lumMax:%d
\n
"
,
filname
,
img
.
pixels
.
col
,
img
.
pixels
.
row
,
img
.
max
);
struct
gfx_context_t
*
ImagePGM
=
initWindow
(
img
.
pixels
.
row
,
img
.
pixels
.
col
,
filname
);
dessineTab2D
(
ImagePGM
,
img
.
pixels
.
data
,
img
.
pixels
.
col
,
img
.
pixels
.
row
);
gfx_present
(
ImagePGM
);
waitSpacePress
();
gfx_destroy
(
ImagePGM
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
traitementPGM.h
+
2
−
0
View file @
4095b411
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include
"Matrix.h"
#include
"Matrix.h"
#include
"math_lib.h"
#include
"math_lib.h"
#include
"gfx.h"
typedef
struct
_pgm
typedef
struct
_pgm
{
{
...
@@ -12,5 +13,6 @@ typedef struct _pgm
...
@@ -12,5 +13,6 @@ typedef struct _pgm
int32_t
pgm_read_from_file
(
pgm
*
p
,
char
*
filename
);
int32_t
pgm_read_from_file
(
pgm
*
p
,
char
*
filename
);
void
pgm_write_to_file
(
pgm
*
p
,
char
*
filename
);
void
pgm_write_to_file
(
pgm
*
p
,
char
*
filename
);
void
PrintImagePGM
(
pgm
img
,
char
*
filname
);
#endif
#endif
\ No newline at end of file
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