[LIBART] rending problem!!!



Hi, sirs,
    I meet a problem on  rendering a vpath which has crossing segments and the crossing point seperates the region into
two parts, the coding is something like this:
 
 ArtVpath vp[] = {
  {ART_MOVETO, 100, 100},
  {ART_LINETO, 100, 0},
  {ART_LINETO, 0, 0},
  {ART_LINETO, 0, 100},
  {ART_LINETO, 200, 100},
  {ART_LINETO, 200, 200},
  {ART_LINETO, 100, 200},
  {ART_LINETO, 100, 100},
  {ART_END, 0, 0}
 };
 ArtSVP* s, * svp = art_svp_from_vpath(vp);
 if(svp){
   s = art_svp_uncross(svp);
   art_svp_free(svp);
   svp = art_svp_rewind_uncrossed (s, ART_WIND_RULE_NONZERO);
   art_svp_free(s);
 }
 if(svp){
 
  art_u8* buffer = art_new (art_u8, WIDTH*HEIGHT*BYTES_PER_PIXEL);
  if(buffer){
 
   art_u32 color = (0xFF << 24) | (0x00 <<16) | (0x00<<8) | (0xAA);
 
   art_rgb_fill_run(buffer, 0xFF, 0xFF, 0xFF, WIDTH * HEIGHT);
   art_rgb_svp_alpha(svp, 0, 0, WIDTH, HEIGHT, color, buffer, WIDTH * BYTES_PER_PIXEL, NULL);
    ...
  }
 }
appreciate if u can offer solution to handle this problem early.
Any comments will be greatly helpful!!
 
ultrasony
20/11/2002
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]