9 { .cmd = "m", .x = 931.07168, .y = 27.69425 },
10 { .cmd = "l", .x = 224.03682, .y = 720.46517 },
11 { .cmd = "l", .x = -63.341, .y = 76.00913 },
12 { .cmd = "L", .x = 931.07168, .y = 486.3269 },
13 { .cmd = "L", .x = 770.37586, .y = 824.16855 },
14 { .cmd = "L", .x = 707.03486, .y = 748.15942 },
15 { .cmd = "L", .x = 931.07168, .y = 27.69425 },
19 { .cmd = "m", .x = 931.07168, .y = 1164.597 },
20 { .cmd = "l", .x = 248.86992, .y = -331.80265 },
21 { .cmd = "l", .x = 416.1687, .y = 1338.32935 },
22 { .cmd = "l", .x = 286.6484, .y = 267.1042 },
23 { .cmd = "l", .x = -520.4224, .y = 0 },
24 { .cmd = "l", .x = -270.2797, .y = -262.2181 },
25 { .cmd = "l", .x = 0, .y = -1033.0627 },
26 { .cmd = "l", .x = -160.98492, .y = 106.6818 },
27 { .cmd = "l", .x = -160.98492, .y = -106.6818 },
28 { .cmd = "l", .x = 0, .y = 1033.0627 },
29 { .cmd = "l", .x = -270.2797, .y = 262.2181 },
30 { .cmd = "l", .x = -520.4224, .y = 0 },
31 { .cmd = "l", .x = 286.6484, .y = -267.1042 },
32 { .cmd = "l", .x = 416.1687, .y = -1338.32935 },
33 { .cmd = "l", .x = 248.86992, .y = 331.80265 },
38 real min_x, max_x, min_y, max_y;
42 merge_bounds(coord_t[] polygon, bounds_t bounds)
47 for (int i = 0; i < dim(polygon); i++) {
48 switch (polygon[i].cmd) {
61 bounds.min_x = bounds.max_x = x;
62 bounds.min_y = bounds.max_y = y;
65 bounds.min_x = min(x, bounds.min_x);
66 bounds.max_x = max(x, bounds.max_x);
67 bounds.min_y = min(y, bounds.min_y);
68 bounds.max_y = max(y, bounds.max_y);
75 print_poly(coord_t[] polygon, real height, bounds_t bounds, real x_pos, real y_pos)
80 real scale = height / (bounds.max_y - bounds.min_y);
81 real x_off = bounds.min_x;
82 real y_off = bounds.min_y;
84 for (int i = 0; i < dim(polygon); i++) {
85 switch (polygon[i].cmd) {
97 printf("\t{ .x = %8.6ff, .y = %8.6ff },\n",
98 imprecise((x - x_off) * scale + x_pos),
99 imprecise((y - y_off) * scale + y_pos));
104 print_logo(string name, real height, real x_pos, real y_pos)
106 bounds_t bounds = { .set = false };
107 bounds = merge_bounds(top, bounds);
108 bounds = merge_bounds(bottom, bounds);
109 printf("const struct ao_coord %s_top[] = {\n", name);
110 print_poly(top, height, bounds, x_pos, y_pos);
113 printf("const struct ao_coord %s_bottom[] = {\n", name);
114 print_poly(bottom, height, bounds, x_pos, y_pos);
117 real width = height * (bounds.max_x - bounds.min_x) / (bounds.max_y - bounds.min_y);
118 printf("static const float %s_height = %8.6ff;\n", name, height);
119 printf("static const float %s_width = %8.6ff;\n", name, width);
122 print_logo(argv[1], 1.0, 0, 0);