void compute_tr_sc_from_exemple (REAL & tr,REAL & sc,REAL u1,REAL u2,REAL w1,REAL w2) { ASSERT_INTERNAL((u1!=u2),"/ by 0 in compute_tr_sc_from_exemple"); sc = (w1-w2) / (u1-u2); compute_tr_from_exemple(tr,sc,u1,w1); }
bool RLE_Pack_Of_Pts::same_line (const RLE_Pack_Of_Pts * pck) const { ASSERT_INTERNAL ( pck->_dim == _dim, "different dim in RLE_Pack_Of_Pts::same_line" ); ASSERT_INTERNAL ( pck->_nb && _nb, "empty pack in RLE_Pack_Of_Pts::same_line" ); for (int i=1; i<_dim ; i++) if (_pt0[i] != pck->_pt0[i]) return false; return true; }
Pack_Of_Pts::type_pack Pack_Of_Pts::type_common(type_pack t1,type_pack t2) { ASSERT_INTERNAL ( (rle < integer) && (integer < real), "Bad odrder for type in Pack_Of_Pts" ); return (type_pack) ElMax((INT)t1,(INT)t2); }
INT RLE_Pack_Of_Pts::proj_brd ( const Pack_Of_Pts * pck_gen, const INT * p0, const INT * p1, INT // rab ) { const RLE_Pack_Of_Pts * pck = pck_gen->rle_cast(); ASSERT_INTERNAL(pck->_nb,"proj_brd with empty pack"); for(int i = 1; i <_dim ; i++) { _pt0[i] = std::max(pck->_pt0[i],p0[i]); _pt0[i] = std::min(_pt0[i],p1[i]-1); } INT xp0 = pck->_pt0[0]; INT X0 = p0[0]; INT X1 = p1[0]; INT x0 = std::max(X0,xp0); if (x0 >= X1) { _pt0[0] = X1-1; _nb = 1; return 0; } INT x1 = std::min(X1,xp0+pck->_nb); if (x1 <= X0) { _pt0[0] = X0; _nb = 1; return pck->_nb-1; } _nb = x1-x0; ASSERT_INTERNAL(_nb>0,"incoherence in proj_brd"); _pt0[0] = x0; return x0-xp0; }
virtual Output_Computed * compute(const Arg_Output_Comp & arg) { ASSERT_INTERNAL ( (*_pack_push)->dim() <= arg.fonc()->idim_out(), "insufficient dim in Push_Values_Out_Not_Comp" ); return out_adapt_type_fonc ( arg, new Push_Values_Out_Comp<Type>(arg,_pack_push), (*_pack_push)->type() ); }
void compute_tr_from_exemple (REAL & tr,REAL sc,REAL u,REAL w) { ASSERT_INTERNAL((sc!=0),"/ by 0 in compute_tr_from_exemple"); tr = (u-w/sc) / SIGN_TO_USER_GEOM; }
INT num_4_freeman(Pt2di p) { ASSERT_INTERNAL(dist4(p) == 1, "incoherence in num_4_freeman"); return p.x ? 1-p.x : 2-p.y; }