void  RImGrid::ExtDef()
{
     Neighbourhood V4 = Neighbourhood::v4();
     Neighbourhood V8 = Neighbourhood::v8();
     Liste_Pts_INT2 anOldL(2);
     bool First = true;

     while(First || (!anOldL.empty()))
     {
         Flux_Pts aFlx = First ?
                         select(mGrid.all_pts(), mGrid.in()!=mDef):
		         anOldL.all_pts();

         Liste_Pts_INT2 aNewL(2);
         ELISE_COPY
         (
            dilate(aFlx,sel_func(V4,mGrid.in(mDef/2)==mDef)),
	    2*mDef,
            mGrid.out() | aNewL
         );
	 
         Neigh_Rel aROK = sel_func(V8,mGrid.in(mDef)!= mDef);
         ELISE_COPY
	 (
	     aNewL.all_pts(),
               aROK.red_sum( mGrid.in())
             / aROK.red_sum(1),
	     mGrid.out()
	 );

	 anOldL = aNewL;
	 First = false;
     }
}
Esempio n. 2
0
void __init 
locate_and_init_vga(void *(*sel_func)(void *, void *))
{
	struct pci_controller *hose = NULL;
	struct pci_dev *dev = NULL;

	
	if (!sel_func) sel_func = (void *)default_vga_hose_select;

	
	for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
		if (!hose)
			hose = dev->sysdata;
		else
			hose = sel_func(hose, dev->sysdata);
	}

	
	if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
		return;

	
	alpha_vga.start += hose->io_space->start;
	alpha_vga.end += hose->io_space->start;
	request_resource(hose->io_space, &alpha_vga);

	
	pci_vga_hose = hose;
	take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
}
Esempio n. 3
0
void __init 
locate_and_init_vga(void *(*sel_func)(void *, void *))
{
	struct pci_controller *hose = NULL;
	struct pci_dev *dev = NULL;

	/* Default the select function */
	if (!sel_func) sel_func = (void *)default_vga_hose_select;

	/* Find the console VGA device */
	for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
		if (!hose)
			hose = dev->sysdata;
		else
			hose = sel_func(hose, dev->sysdata);
	}

	/* Did we already initialize the correct one? Is there one? */
	if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
		return;

	/* Create a new VGA ioport resource WRT the hose it is on. */
	alpha_vga.start += hose->io_space->start;
	alpha_vga.end += hose->io_space->start;
	request_resource(hose->io_space, &alpha_vga);

	/* Set the VGA hose and init the new console. */
	pci_vga_hose = hose;
	console_lock();
	do_take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
	console_unlock();
}
Esempio n. 4
0
void bench_fr_front_to_surf
     (
          Flux_Pts       front,
          Im2D_U_INT1    i0,
          Neighbourhood  v
     )
{
     Pt2di sz (i0.tx(),i0.ty());

     Im2D_U_INT1 i1(sz.x,sz.y,0);
     ELISE_COPY(i0.all_pts(),i0.in(),i1.out());

     ELISE_COPY
     (
          dilate
          (
               select
               (
                    i1.all_pts(),
                    i1.in()==1
               ),
               sel_func(v,i1.in()==0)
          ),
          2,
          i1.out()
     );

     ELISE_COPY(front,2,i0.out());

     INT dif;
     ELISE_COPY
     (
          i1.all_pts(),
          Abs(i1.in()-i0.in()),
          sigma(dif)
     );

      BENCH_ASSERT(dif == 0);
}
Esempio n. 5
0
void __init 
locate_and_init_vga(void *(*sel_func)(void *, void *))
{
	struct pci_controller *hose = NULL;
	struct pci_dev *dev = NULL;

	if (!sel_func) sel_func = (void *)default_vga_hose_select;

	for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
		if (!hose) hose = dev->sysdata;
		else hose = sel_func(hose, dev->sysdata);
	}

	/* Did we already inititialize the correct one? */
	if (conswitchp == &vga_con &&
	    __vga_hose_io_base == hose->io_space->start &&
	    __vga_hose_mem_base == hose->mem_space->start)
		return;

	/* Set the VGA hose and init the new console */
	set_vga_hose(hose);
	take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
}
Esempio n. 6
0
void bench_front_to_surf
     (
          Flux_Pts   front_8,
          Flux_Pts   front_4,
          Flux_Pts   surf_with_fr,
          Flux_Pts   surf_without_fr,
          Fonc_Num   fcarac,
          bool       with_fc,
          bool       test_dil,
          Pt2di      sz
     )
{
     Im2D_U_INT1 i1(sz.x,sz.y,0);
     Im2D_U_INT1 i2(sz.x,sz.y,0);

     INT dif;
     if (with_fc)
     {
         ELISE_COPY(surf_without_fr,1,i1.out());
         ELISE_COPY(i2.all_pts(),fcarac,i2.out());

         ELISE_COPY(i1.all_pts(),Abs(i1.in()-i2.in()),sigma(dif));

          BENCH_ASSERT(dif == 0);
     }
     else
         ELISE_COPY(surf_without_fr,1,i1.out()|i2.out());

     Neighbourhood v4 (TAB_4_NEIGH,4);
     Neighbourhood v8 (TAB_8_NEIGH,8);
     
     if (test_dil)
     {
         bench_fr_front_to_surf(front_8,i1,v4);

         bench_fr_front_to_surf(front_4,i2,v8);
     }


     ELISE_COPY(i1.all_pts(),1,i1.out());
     ELISE_COPY(i1.border(1),0,i1.out());
     ELISE_COPY(front_8,0,i1.out());
     ELISE_COPY(conc(Pt2di(1,1),sel_func(v4,i1.in()==1)),0,i1.out());

     ELISE_COPY(i2.all_pts(),0,i2.out());
     ELISE_COPY(surf_without_fr,1,i2.out());
     ELISE_COPY(i1.all_pts(),Abs(i1.in()-i2.in()),sigma(dif));
      
     BENCH_ASSERT(dif == 0);


     ELISE_COPY(i1.all_pts(),0,i1.out() | i2.out());

     ELISE_COPY(surf_with_fr   ,1,i1.out());
     ELISE_COPY(surf_without_fr,2,i1.histo());

     ELISE_COPY(surf_with_fr   ,3,i2.out());
     ELISE_COPY(front_8        ,1,i2.out());

     
     ELISE_COPY(i1.all_pts(),Abs(i1.in()-i2.in()),sigma(dif));

     BENCH_ASSERT(dif == 0);

}