Example #1
0
static ArtSVP *
art_svp_merge_perturbed (const ArtSVP *svp1, const ArtSVP *svp2)
{
  ArtVpath *vpath1, *vpath2;
  ArtVpath *vpath1_p, *vpath2_p;
  ArtSVP *svp1_p, *svp2_p;
  ArtSVP *svp_new;

  vpath1 = art_vpath_from_svp (svp1);
  vpath1_p = art_vpath_perturb (vpath1);
  art_free (vpath1);
  svp1_p = art_svp_from_vpath (vpath1_p);
  art_free (vpath1_p);

  vpath2 = art_vpath_from_svp (svp2);
  vpath2_p = art_vpath_perturb (vpath2);
  art_free (vpath2);
  svp2_p = art_svp_from_vpath (vpath2_p);
  art_free (vpath2_p);

  svp_new = art_svp_merge (svp1_p, svp2_p);
#ifdef VERBOSE
  print_ps_svp (svp1_p);
  print_ps_svp (svp2_p);
  print_ps_svp (svp_new);
#endif
  art_free (svp1_p);
  art_free (svp2_p);

  return svp_new;
}
Example #2
0
/**
 * art_uta_from_svp: Generate uta covering an svp.
 * @svp: The source svp.
 *
 * Generates a uta covering @svp. The resulting uta is of course
 * approximate, ie it may cover more pixels than covered by @svp.
 *
 * Note: I will want to replace this with a more direct
 * implementation. But this gets the api in place.
 *
 * Return value: the new uta.
 **/
ArtUta *
art_uta_from_svp (const ArtSVP *svp)
{
  ArtVpath *vpath;
  ArtUta *uta;

  vpath = art_vpath_from_svp (svp);
  uta = art_uta_from_vpath (vpath);
  art_free (vpath);
  return uta;
}