[vtkusers] Bug in font rendering if shadow == true ?

Antoine Rosset rossetantoine at bluewin.ch
Sun Apr 6 02:18:52 EDT 2008


It seems there is a problem with antialiased font rendering if shadow  
is activated. See the letters on the corners on this image: http://www.osirix-viewer.com/before.jp2 
  . See this image after the correction: http://www.osirix-viewer.com/after.jp2 
  .There are blending problems with the alpha channel.

To correct this problem, I changed the vtkFreeTypeUtilities.cxx  
PopulateImageData :

           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_r);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_g);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_b);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * (t_alpha + data_alpha *  
t_1_m_alpha));

To

           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_r*t_alpha +
                 (*data_ptr * data_alpha) * t_1_m_alpha);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_g*t_alpha +
                 (*data_ptr * data_alpha) * t_1_m_alpha);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * tprop_b*t_alpha +
                 (*data_ptr * data_alpha) * t_1_m_alpha);
           data_ptr++;
		
           *data_ptr = static_cast<unsigned char>(
             data_min + data_range * (t_alpha + data_alpha *  
t_1_m_alpha));

This correction was existing 3 years ago in the source code, but was  
removed : cvs diff (http://public.kitware.com/cgi-bin/viewcvs.cgi/Rendering/vtkFreeTypeUtilities.cxx?r1=1.29&r2=1.5.2.1 
)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080406/46375883/attachment.htm>


More information about the vtkusers mailing list