00001
00002
00003
00004
00005
00010 #include <flgrCoreTypes.h>
00011 #include <flgrCoreErrors.h>
00012 #include <flgrCoreData.h>
00013 #include <flgrImageIO.h>
00014 #include <flgrRtView.h>
00015 #include <flgrMorphoBase.h>
00016
00017 int main(void) {
00018 FLGR_Data2D *imin;
00019 FLGR_Data2D *imout;
00020 FLGR_Data2D *imtmp;
00021 FLGR_Data2D *nhb;
00022 FLGR_RtView2D *scr0;
00023 int i;
00024
00025 imin = flgr2d_load_pgm("../../images/gray/lena.pgm");
00026 imout = flgr2d_create_pixmap_from(imin);
00027 imtmp = flgr2d_create_pixmap_from(imin);
00028
00029
00030 scr0 = flgr2d_rtview_create(imin, 1, 2);
00031
00032 flgr2d_rtview_refresh(scr0, imin, 0, 0);
00033 flgr2d_copy(imout,imin);
00034
00035 for( i=1 ; i<100 ; i++) {
00036 nhb = flgr2d_create_neighborhood(i*2+1,i*2+1,imin->spp,imin->type,FLGR_RECT,FLGR_8_CONNEX);
00037 flgr2d_open(imtmp,imout,nhb);
00038 flgr2d_close(imout,imtmp,nhb);
00039 flgr2d_rtview_refresh(scr0, imout, 0, 1);
00040 flgr2d_destroy(nhb);
00041 }
00042
00043 flgr2d_save_pgm(imout,"output.pgm",5);
00044
00045 flgr2d_destroy(imin);
00046 flgr2d_destroy(imout);
00047 flgr2d_destroy(imtmp);
00048 flgr2d_rtview_destroy(scr0);
00049
00050 }
00051
00052