freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] coverage algorithm of ft_grays.c ?


From: Huang Koffman
Subject: [ft-devel] coverage algorithm of ft_grays.c ?
Date: Wed, 27 Jun 2007 13:10:09 +0800

Dear David,

 

  I try to trace ft_grays.c for speed up. And I have some question. Can you tell me please.

  I cannot understand the coverage algorithm.

 

  1. As below, Coverage = area/(Pixel_Bit*Pixel_Bit/2) why?

 

    /* compute the coverage line's coverage, depending on the              */

    /* outline fill rule                                                                           */

    /*                                                                                                */

    /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2)       */

    /*                                                                                                */

    coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) );

                                            /* use range 0..256 */

 

  2.The area value should be "(fx1+fx2)/2*delta" if it is a trapezoid. But not in below code. Why?

   

    /* everything is located in a single cell.  That is easy!                              */

    /*                                                                                                        */

    if ( ex1 == ex2 )

    {

      delta      = y2 - y1;

      ras.area  += (TArea)( fx1 + fx2 ) * delta;

      ras.cover += delta;

      return;

    }

 

Regards,

Koffman


reply via email to

[Prev in Thread] Current Thread [Next in Thread]