Hi, 
My application is as follows: 
fb0 - OSD 
fb2 - video 

If magenta is used on fb0 then this is transparent and the underlying video
on fb2 is visible.  Any other colour appears drawn on top of the video. 

The problem is that the edges of text and images drawn by Directfb appear
slightly blurred and appear a pinky colour (Nearly magenta) 

See this image: 
http://www.nabble.com/file/p19898305/DistortedImage.jpeg 

To stop this I am trying to turn off anti -aliasing.  Here is my code: 

DFBFontDescription font_dsc; 
        
DFBSurfaceDescription dsc; 
DFBCHECK (DirectFBInit (&argc, &argv)); 
DFBCHECK (DirectFBCreate (&dfb)); 

DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)); 
                                                                                
dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS); 
dsc.caps  = (DFBSurfaceCapabilities) (DSCAPS_PRIMARY | DSCAPS_FLIPPING); 
DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary )); 

DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height)); 

//Set Render options for drawing and blitting operations
DFBSurfaceRenderOptions render_options =
(DFBSurfaceRenderOptions)(DSRO_NONE); = No anti-aliasing for edges 
primary->SetRenderOptions( primary, render_options ); 
        

font_dsc.flags = (DFBFontDescriptionFlags)(DFDESC_HEIGHT |
DFDESC_ATTRIBUTES); 
font_dsc.height = 32;   
font_dsc.attributes = DFFA_MONOCHROME; //Try to not use anti -aliasing

DFBCHECK (dfb->CreateFont (dfb, "times.ttf", &font_dsc, &font)); 
DFBCHECK (primary->SetFont (primary, font)); 
        
DFBCHECK (primary->SetColor (primary, 0xff, 0x00, 0xff, 0)); 
DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width,
screen_height));//Fill background with magenta 
DFBCHECK (primary->SetColor (primary, 255, 0, 0, 0)); 
DFBCHECK (primary->FillRectangle (primary, 50, 50, 100, 100));//Draw a small
rectangle on screen 

DFBCHECK (primary->SetColor (primary, 255, 255, 255, 0)); 
DFBCHECK (primary->FillRectangle (primary, 200, 200, 170, 170));//Draw
another small rectangle on screen 

DFBCHECK (primary->DrawString (primary, "THIS IS A TEST", -1, 300, 150
,DSTF_LEFT));//write some text 
    
DFBCHECK (primary->Flip (primary, NULL, DSFLIP_NONE)); 

sleep(10); 

primary->Release( primary ); 
dfb->Release( dfb ); 

-- 
View this message in context: 
http://www.nabble.com/Another-anti-aliasing-question-tp19898305p19898305.html
Sent from the DirectFB Dev mailing list archive at Nabble.com.

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to