00001
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <math.h>
00013 #include <string.h>
00014 #include <inrimage/image.h>
00015 #include "interpolation.h"
00016
00021 static char Ucmd[]=
00022 "[s2D] [d2D] [s3D] [d3D] [-xp x_pas] [-yp y_pas] [-x X] [-y Y] [-z Z] [-x0 X0] [-y0 Y0] [-min MIN] [-max MAX] [-cache cache_size] [-time time_flag]";
00023
00027 static char Udetail[]=
00028 "genere s3D et d3D les sous-echantillons sur Z plans ,par pas de x_pas et y_pas, des images en 3D\nissues de s2D et d2D considerees\nen tronquant x0 lignes et y0 colonnes.\nSi on donne un pas et une dimension, on prend en compte en priorite la dimension. Si aucun argument n'est donne, on prend un pas de 1. On peut preciser les bornes que l'on veut pour l'etalement des valeurs des images sources.";
00029
00030 int main(int argc,char ** argv)
00031 {
00032 char s2D[80]="",d2D[80]="",s3D[80]="",d3D[80]="";
00033 int x_pas=1,y_pas=1;
00034 int x=0,y=0,z=0;
00035 int x0=0,y0=0;
00036 int taille_cache=1,time_flag=0;
00037 float min2D=0,max2D=0;
00038
00039 inr_init(argc,argv,"1.0",Ucmd,Udetail);
00040
00041 infileopt(s2D);
00042 infileopt(d2D);
00043 outfileopt(s3D);
00044 outfileopt(d3D);
00045
00046
00047
00048 if (!igetopt1("-xp","%d",&x_pas))
00049 x_pas=1;
00050 if (!igetopt1("-yp","%d",&y_pas))
00051 y_pas=1;
00052 if (!igetopt1("-x","%d",&x))
00053 x=0;
00054 if (!igetopt1("-y","%d",&y))
00055 y=0;
00056 if (!igetopt1("-z","%d",&z))
00057 z=0;
00058 if (!igetopt1("-x0","%d",&x0))
00059 x0=0;
00060 if (!igetopt1("-y0","%d",&y0))
00061 y0=0;
00062 if (!igetopt1("-cache","%d",&taille_cache))
00063 taille_cache=1;
00064 if (!igetopt1("-time","%d",&time_flag))
00065 time_flag=0;
00066 if(!igetopt1("-min","%f",&min2D))
00067 min2D=-1;
00068 if(!igetopt1("-max","%f",&max2D))
00069 max2D=-1;
00070
00071
00072 if(tstopts())
00073 iusage_(Ucmd,Udetail);
00074
00075 plan2volcal(s2D,d2D,s3D,d3D,(float)x_pas,(float)y_pas,x,y,z,x0,y0,min2D,max2D,taille_cache,time_flag);
00076
00077 return EXIT_SUCCESS;
00078 }