Last change
on this file since 29 was
29,
checked in by sven, 15 years ago
|
I think that was the some kind of
|
-
Property svn:executable set to
*
|
File size:
1.0 KB
|
Line | |
---|
1 | |
---|
2 | #include <stdio.h> |
---|
3 | #include <stdlib.h> |
---|
4 | #include <string.h> |
---|
5 | #include <argp.h> |
---|
6 | |
---|
7 | #include "lochstreifen.h" |
---|
8 | |
---|
9 | int main(int argc, char *argv[]) { |
---|
10 | LOCHSTREIFEN *l; |
---|
11 | cairo_t *cr; |
---|
12 | cairo_surface_t *surface; |
---|
13 | byte_t data[256]; |
---|
14 | int length = 255; |
---|
15 | int x; |
---|
16 | |
---|
17 | for(x=0; x < 256; x++) { |
---|
18 | printf("Assigning %x\n", x); |
---|
19 | data[x] = x; |
---|
20 | } |
---|
21 | |
---|
22 | printf("a\n"); |
---|
23 | l = (LOCHSTREIFEN*)lochstreifen_new(); |
---|
24 | printf("a\n"); |
---|
25 | lochstreifen_set_data(l, length, data); |
---|
26 | printf("b\n"); |
---|
27 | surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, |
---|
28 | 5000, 300); |
---|
29 | printf("c\n"); |
---|
30 | cr = cairo_create(surface); |
---|
31 | |
---|
32 | cairo_set_source(cr, cairo_pattern_create_rgb(0.123, 0.456, 0.789)); |
---|
33 | cairo_paint(cr); |
---|
34 | |
---|
35 | cairo_scale(cr, 200, 200); |
---|
36 | printf("d\n"); |
---|
37 | lochstreifen_draw(l, cr); |
---|
38 | printf("e\n"); |
---|
39 | |
---|
40 | cairo_surface_write_to_png(surface, "/tmp/test.png"); |
---|
41 | |
---|
42 | printf("paper tape SVG generated: %s\n", cairo_status_to_string(cairo_surface_status(surface))); |
---|
43 | |
---|
44 | return 0; |
---|
45 | } // main |
---|
Note: See
TracBrowser
for help on using the repository browser.