Пример #1
0
         bool GenScaleIm<TObj>::do_it_gen(Pt2dr tr,REAL sc,Pt2di  pW0,Pt2di  pW1)
{

	_tr = tr;
	_sc = sc;
    XTransfo.Set(_tr.x,_sc);
    YTransfo.Set(_tr.y,_sc);


	_CoeffPds = round_ni(100.0/sc);
	pt_set_min_max(pW0,pW1);

	Pt2dr pu0 = Sup(Pt2dr(to_user(Pt2dr(pW0))),Pt2dr(0.0,0.0));
 	Pt2dr pu1 = Inf(Pt2dr(to_user(Pt2dr(pW1))),Pt2dr(_SzU));


	pW0 = Sup(Pt2di(0,0),round_down(to_window(pu0)));
	pW1 = Inf(_SzW		,round_up(to_window(pu1)));



	_pW0 = pW0;
	_pW1 = pW1;


	_xU0 = std::max(0		, round_down(0.5+x_to_user(_pW0.x-0.5)));
	_xU1 = std::min(_SzU.x	, round_up  (0.5+x_to_user(_pW1.x-0.5)));
	_yU0 = std::max(0		, round_down(0.5+y_to_user(_pW0.y-0.5)));
	_yU1 = std::min(_SzU.y	, round_up  (0.5+y_to_user(_pW1.y-0.5)));


    	if ((_xU0 >=_xU1) || (_yU0 >= _yU1))
           return false;

	for (INT ux=_xU0; ux<=_xU1 ; ux++)
	{
	     _u2wX[ux] =  FitInWX(PremPixelU2WX(ux));
    }

	for (INT uy=_yU0; uy<=_yU1 ; uy++)
	{
	     _u2wY[uy] =  FitInWY(PremPixelU2WY(uy));
    }

	for (INT wx= 0;wx<= _SzW.x ; wx++)	
	{
		 _Cw2uX[wx] = PixCenterW2U_x(wx);
	}
	for (INT wy=0;wy<= _SzW.y ; wy++)	
	{
		 _Cw2uY[wy] = PixCenterW2U_y(wy);
	}

     return true;
}
Пример #2
0
window burst_serv::get_result_at(const std::string& keyword,
                                 double pos) const {
  return to_window(burst_->get_result_at(keyword, pos));
}
Пример #3
0
window burst_serv::get_result(const std::string& keyword) const {
  return to_window(burst_->get_result(keyword));
}