bool rel_expr_is_term(rel_expr re)
 {
   if (!is_affine(re->nodeaffine))
      return true;

   switch (re->nodeop)
     {
       case op_or:
       case op_and:
       case op_not:
           return false;
       default:
           assert (compare_op(re->nodeop) || re->nodeaffine);
           return true;
     }
 }
Beispiel #2
0
static INLINE void map_point(float *mat, float x, float y,
                             float *out_x, float *out_y)
{
   if (!mat) {
      *out_x = x;
      *out_y = y;
      return;
   }

   *out_x = mat[0]*x + mat[3]*y + mat[6];
   *out_y = mat[1]*x + mat[4]*y + mat[7];
   if (!is_affine(mat)) {
      float w = 1/(mat[2]*x + mat[5]*y + mat[8]);
      *out_x *= w;
      *out_y *= w;
   }
}