loaders: Add TmpFile interface.
[gfxprim.git] / doc / examples.txt
blobec356e2e074ac192f6c146ea51bc83e8c671b151
1 GFXprim Code Examples
2 =====================
3 Cyril Hrubis <metan@ucw.cz>
5 Image loaders examples
6 ----------------------
8 Loads an image and saves it into 'out.png' png image.
10 Example in C
11 ~~~~~~~~~~~~
13 [source,c]
14 ------------------------------------------------------------------
15 include::../demos/c_simple/loaders_example.c[]
16 ------------------------------------------------------------------
18 Example in C utilizing progress callback
19 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 [source,c]
22 ------------------------------------------------------------------
23 include::../demos/c_simple/loaders.c[]
24 ------------------------------------------------------------------
26 Example in C using image meta-data interface
27 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 [source,c]
30 ------------------------------------------------------------------
31 include::../demos/c_simple/meta_data.c[]
32 ------------------------------------------------------------------
34 [source,c]
35 ------------------------------------------------------------------
36 include::../demos/c_simple/meta_data_dump.c[]
37 ------------------------------------------------------------------
39 Example in Python
40 ~~~~~~~~~~~~~~~~~
42 [source,python]
43 ------------------------------------------------------------------
44 include::../demos/py_simple/loaders_example.py[]
45 ------------------------------------------------------------------
47 GFX Examples
48 ------------
50 Drawing Lines
51 ~~~~~~~~~~~~~
53 Example in C
54 ^^^^^^^^^^^^
56 [source,c]
57 ------------------------------------------------------------------
58 include::../demos/c_simple/gfx_koch.c[]
59 ------------------------------------------------------------------
61 Filters
62 -------
64 Symmetry filters (Rotation, Mirroring)
65 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67 Example in C
68 ^^^^^^^^^^^^
70 [source,c]
71 ------------------------------------------------------------------
72 include::../demos/c_simple/filters_symmetry.c[]
73 ------------------------------------------------------------------
75 Example in Python
76 ^^^^^^^^^^^^^^^^^
78 [source,python]
79 ------------------------------------------------------------------
80 include::../demos/py_simple/rotate90.py[]
81 ------------------------------------------------------------------
83 Simple backend example
84 ----------------------
86 Basic backend code example. Initalizes backends, draws a cross and dumps
87 events.
89 Example in C
90 ~~~~~~~~~~~~
92 [source,c]
93 ------------------------------------------------------------------
94 include::../demos/c_simple/backend_example.c[]
95 ------------------------------------------------------------------
97 GFXprim + PyGTK
98 ---------------
100 [source,python]
101 ------------------------------------------------------------------
102 include::../demos/py_simple/pygtk_example.py[]
103 ------------------------------------------------------------------