/[crust]/crust/libs/GraphicsFoundation/testsuite/bitmap-test-render.c
ViewVC logotype

Diff of /crust/libs/GraphicsFoundation/testsuite/bitmap-test-render.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jrydberg, Sun Aug 26 20:46:03 2001 UTC revision 1.2 by jrydberg, Mon Aug 27 22:27:52 2001 UTC
# Line 27  Line 27 
27  #include <math.h>  #include <math.h>
28    
29  #define IMAGE_WIDTH  800  #define IMAGE_WIDTH  800
30  #define IMAGE_HEIGHT 500  #define IMAGE_HEIGHT 250
31  #define IMAGE_PITCH  (IMAGE_WIDTH * 4)  #define IMAGE_PITCH  (IMAGE_WIDTH * 4)
32    
33    extern void GFContextShowTextAtPoint (GFContextRef, float, float, char *, int);                                
34    extern int
35    GFContextSelectFont (GFContextRef context, char *font_name, char *style_name,
36                         float size);
37                        
38  int  int
39  main (int argc, char *argv)  main (int argc, char *argv)
40  {  {
# Line 54  main (int argc, char *argv) Line 59  main (int argc, char *argv)
59    
60        GFContextSaveGState (context);        GFContextSaveGState (context);
61    
62        GFContextSetRGBFillColor (context, 0.6, 0.8, 0.8, 0.8);        GFContextSetRGBFillColor (context, 0.0, 0.0, 0.0, 0.8);
63        GFContextBeginPath (context);  
64          GFContextSelectFont (context, "Courier", "Bold", 40.0);
65          GFContextShowTextAtPoint (context, (float) 250.0, IMAGE_HEIGHT/2,
66                                    "Crust Display System",
67                                    strlen ("Crust Display System"));
68    
69        GFContextMoveToPoint (context,        15 * 10,     27 * 10);        GFContextBeginPath (context);
70        GFContextAddLineToPoint (context,  7.947 * 10,  5.292 * 10);        GFContextMoveToPoint (context,        15 * 8,     27 * 8);
71        GFContextAddLineToPoint (context, 26.413 * 10, 18.708 * 10);        GFContextAddLineToPoint (context,  7.947 * 8,  5.292 * 8);
72        GFContextAddLineToPoint (context,  3.587 * 10, 18.708 * 10);        GFContextAddLineToPoint (context, 26.413 * 8, 18.708 * 8);
73        GFContextAddLineToPoint (context, 22.053 * 10,  5.292 * 10);        GFContextAddLineToPoint (context,  3.587 * 8, 18.708 * 8);
74        GFContextAddLineToPoint (context,     15 * 10,     27 * 10);        GFContextAddLineToPoint (context, 22.053 * 8,  5.292 * 8);
75          GFContextAddLineToPoint (context,     15 * 8,     27 * 8);
76    
77        GFContextDrawPath (context, kGFPathEOFill);        GFContextDrawPath (context, kGFPathEOFill);
78        GFContextSetRGBFillColor (context, 1.0, 0.8, 0.8, 0.8);        GFContextSetRGBFillColor (context, 1.0, 0.8, 0.8, 0.8);
# Line 73  main (int argc, char *argv) Line 83  main (int argc, char *argv)
83    
84        GFContextRestoreGState (context);        GFContextRestoreGState (context);
85    
       GFContextSetRGBStrokeColor (context, 0.8, 1.0, 1.0, 0.85);  
       GFContextBeginPath (context);  
       GFContextMoveToPoint (context, 10.0, IMAGE_HEIGHT / 2);  
   
       GFContextSetLineWidth (context, 20.0);  
   
       GFContextAddCurveToPoint (context,  
                                 260, IMAGE_HEIGHT - 10,  
                                 260, IMAGE_HEIGHT - 10,  
                                 IMAGE_WIDTH - 10, IMAGE_HEIGHT / 2);  
       GFContextStrokePath (context);  
   
   
   
86        fp = fopen ("bitmap-test-render.rgba", "w");        fp = fopen ("bitmap-test-render.rgba", "w");
87        if (fp)        if (fp)
88          {          {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26