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 |
{ |
{ |
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); |
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 |
{ |
{ |