1 | #include <stdlib.h>
|
---|
2 | #include <stdio.h>
|
---|
3 | #include <string.h>
|
---|
4 |
|
---|
5 | #include "ctimer.h"
|
---|
6 | #include "imageop.h"
|
---|
7 |
|
---|
8 | #include "pidemoup.h"
|
---|
9 |
|
---|
10 | FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp,
|
---|
11 | char * arg1, char * arg2)
|
---|
12 | {
|
---|
13 | printf(" PIUserProc_1(%d %d %s %s) Filtrage passe-bas 3*3 \n", xp, yp, arg1, arg2);
|
---|
14 | ImageR4 filt(3,3);
|
---|
15 | FitsImageR4 * out;
|
---|
16 |
|
---|
17 | // Definition du filtre passe-bas
|
---|
18 | int i,j;
|
---|
19 | for(i=0; i<3; i++)
|
---|
20 | for(j=0; j<3; j++) filt(i,j) = 0.06;
|
---|
21 | filt(1,1) = 0.52;
|
---|
22 |
|
---|
23 | filt.PrintPave();
|
---|
24 | out = new FitsImageR4(myimg->XSize(), myimg->YSize());
|
---|
25 | TIMEF ;
|
---|
26 | FilterImage((ImageR4 *) myimg, (ImageR4 *)out, &filt);
|
---|
27 | return(out);
|
---|
28 | }
|
---|
29 |
|
---|
30 | FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp,
|
---|
31 | char * arg1, char * arg2)
|
---|
32 | {
|
---|
33 | printf(" PIUserProc_2(%d %d %s %s) Ombre 3*3 \n", xp, yp, arg1, arg2);
|
---|
34 | ImageR4 filt(3,3);
|
---|
35 | FitsImageR4 * out;
|
---|
36 |
|
---|
37 | // Definition du filtre ombre
|
---|
38 | int i,j;
|
---|
39 | filt(0,0) = filt(1,1) = filt(2,2) = 0.;
|
---|
40 | filt(0,1) = filt(1,2) = -1.;
|
---|
41 | filt(1,0) = filt(2,1) = 1.;
|
---|
42 | filt(0,2) = -2.;
|
---|
43 | filt(2,0) = 2.;
|
---|
44 | filt.PrintPave();
|
---|
45 | out = new FitsImageR4(myimg->XSize(), myimg->YSize());
|
---|
46 | TIMEF ;
|
---|
47 | FilterImage((ImageR4 *) myimg, (ImageR4 *)out, &filt);
|
---|
48 | return(out);
|
---|
49 | }
|
---|
50 |
|
---|
51 | FitsImageR4 * PIUserProc_3(FitsImageR4 * /*myimg*/, int xp, int yp,
|
---|
52 | char * arg1, char * arg2)
|
---|
53 | {
|
---|
54 | printf(" PIUserProc_3(%d %d %s %s) ne fait rien \n", xp, yp, arg1, arg2);
|
---|
55 | return(NULL);
|
---|
56 | }
|
---|
57 |
|
---|