/*************************************************************************************************************************************/ /* */ /* E T U D E D E L A C O M P L E X I T E S T R U C T U R E L L E */ /* D ' U N P O R T R A I T R E E L ( L E N A ) : */ /* */ /* */ /* Author of '$xrC/ObjetComplexe.T____1$vv$c' : */ /* */ /* Jean-Francois Colonna (LACTAMME, 20130729092921). */ /* */ /*************************************************************************************************************************************/ #ifdef COMMENTS # undef COMMENTS #else #endif #define COMMENTS "Portrait reel -Lena- (format octet) -luminance-" #define DEFINE_01 "-DNOMBRE_PAVE_X=1 -DNOMBRE_PAVE_Y=1" #define DEFINE_02 "-DNOMBRE_PAVE_X=2 -DNOMBRE_PAVE_Y=2" #define DEFINE_03 "-DNOMBRE_PAVE_X=3 -DNOMBRE_PAVE_Y=3" #define DEFINE_04 "-DNOMBRE_PAVE_X=4 -DNOMBRE_PAVE_Y=4" #define DEFINE_05 "-DNOMBRE_PAVE_X=5 -DNOMBRE_PAVE_Y=5" #define DEFINE_06 "-DNOMBRE_PAVE_X=6 -DNOMBRE_PAVE_Y=6" #define DEFINE_07 "-DNOMBRE_PAVE_X=7 -DNOMBRE_PAVE_Y=7" #define DEFINE_08 "-DNOMBRE_PAVE_X=8 -DNOMBRE_PAVE_Y=8" #define DEFINE_09 "-DNOMBRE_PAVE_X=9 -DNOMBRE_PAVE_Y=9" #define DEFINE_10 "-DNOMBRE_PAVE_X=10 -DNOMBRE_PAVE_Y=10" #define DEFINE_11 "-DNOMBRE_PAVE_X=11 -DNOMBRE_PAVE_Y=11" #define DEFINE_12 "-DNOMBRE_PAVE_X=12 -DNOMBRE_PAVE_Y=12" #define DEFINE_13 "-DNOMBRE_PAVE_X=13 -DNOMBRE_PAVE_Y=13" #define DEFINE_14 "-DNOMBRE_PAVE_X=14 -DNOMBRE_PAVE_Y=14" #define DEFINE_15 "-DNOMBRE_PAVE_X=15 -DNOMBRE_PAVE_Y=15" #define DEFINE_16 "-DNOMBRE_PAVE_X=16 -DNOMBRE_PAVE_Y=16" #include "images_1octet.01.vv.I" #ifndef NOMBRE_PAVE_X # define NOMBRE_PAVE_X \ (4) #else #endif #ifndef NOMBRE_PAVE_Y # define NOMBRE_PAVE_Y \ (4) #else #endif int nombre_pave_X=NOMBRE_PAVE_X; int nombre_pave_Y=NOMBRE_PAVE_Y; #define NOM_DE_L_IMAGE_RELLE \ xiirC"IMAGE_REELLE.LENA.11" TypeImage image_reelle[]={ #include "ChaineOctetsUniformesAlternees_1024x1024.08.vv.I" }; /* Cette facon de faire (lineariser l'image) est destinee a faire que le source, commme */ /* binaire non executable, aient des longueurs proportionnelles a la taille de l'image). */ /* On notera de plus que cette chaine ne peut etre nulle (voire uniforme), c'est pourquoi */ /* la repetition {0,1} est utilisee... */ MAIN( { int pave_X=DIVI(dimX,nombre_pave_X); int pave_Y=DIVI(dimY,nombre_pave_Y); TypeImage image_temporaire[dimY][dimX]; ACCES_IMAGE_REELLE(NOM_DE_L_IMAGE_RELLE); for (y=Ymin ; y <= Ymax ; y=ADD2(y,1)) { for (x=Xmin ; x <= Xmax ; x=ADD2(x,1)) { int xQ=DIVI(SOUS(x,Xmin),pave_X); int xR=REST(SOUS(x,Xmin),pave_X); int yQ=DIVI(SOUS(y,Ymin),pave_Y); int yR=REST(SOUS(y,Ymin),pave_Y); int xp; int yp; xp=ADD2(ADD2(xQ,MUL2(nombre_pave_X,xR)),Xmin); yp=ADD2(ADD2(yQ,MUL2(nombre_pave_Y,yR)),Ymin); if ((xp <= Xmax) && (yp <= Ymax)) { gSTORE_IMAGE_PLAN(image_temporaire,x,y,LOAD_IMAGE_PLAN_BIT_OCTET(xp,yp)); } else { } } } INITIALISATION_IMAGE(gLOAD_IMAGE_PLAN_BIT_OCTET(image_temporaire,x,y)); SORTIE_DU_FICHIER_IMAGE; EDITER_LES_COMPTEURS_DES_FONCTIONS; } )