Commit 5fdd8756359433583b7e3aea100e9cf6a2b4436b
Add readme and license
Charles Lehner committed on 2/10/2015, 2:24:04 PMParent: a18e2f94c5c1c202b703482e5aabdaa261c3d95a
Files changed
License | added |
Readme.md | added |
License | ||
---|---|---|
@@ -1,0 +1,20 @@ | ||
1 … | +The MIT License (MIT) | |
2 … | +Copyright © 2015 Charles Lehner | |
3 … | + | |
4 … | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
5 … | +of this software and associated documentation files (the “Software”), to deal | |
6 … | +in the Software without restriction, including without limitation the rights | |
7 … | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
8 … | +copies of the Software, and to permit persons to whom the Software is | |
9 … | +furnished to do so, subject to the following conditions: | |
10 … | + | |
11 … | +The above copyright notice and this permission notice shall be included in | |
12 … | +all copies or substantial portions of the Software. | |
13 … | + | |
14 … | +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 … | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 … | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 … | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 … | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 … | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
20 … | +THE SOFTWARE. |
Readme.md | ||
---|---|---|
@@ -1,0 +1,51 @@ | ||
1 … | +# pngspark | |
2 … | + | |
3 … | +[Sparklines](https://github.com/holman/spark) as PNGs. | |
4 … | + | |
5 … | +## Install | |
6 … | +``` | |
7 … | +make | |
8 … | +[sudo] make install [PREFIX=/usr/local] | |
9 … | +``` | |
10 … | + | |
11 … | +## Usage | |
12 … | +``` | |
13 … | +pngspark [-h height] [-c color] [-s scaling] output.png | |
14 … | +``` | |
15 … | + | |
16 … | +### Options | |
17 … | +* `-h height`: the height of the image in pixels | |
18 … | +* `-c color`: the color of the foreground, as #rrggbb hex | |
19 … | +* `-s scaling`: scaling factor. 0 to do no scaling, 1 to make the minimum | |
20 … | + value be at the bottom of the image | |
21 … | + | |
22 … | +## API | |
23 … | + | |
24 … | +```c | |
25 … | +struct pngspark; | |
26 … | +``` | |
27 … | +A png spark instance: collection of values and settings. | |
28 … | + | |
29 … | +```c | |
30 … | +int pngspark_init(struct pngspark *ps, size_t height, const char *color, double scaling); | |
31 … | +``` | |
32 … | +Initialize a pngspark struct. | |
33 … | + | |
34 … | +```c | |
35 … | +int pngspark_append(struct pngspark *ps, double, value); | |
36 … | +``` | |
37 … | +Append a value to the pngspark. | |
38 … | + | |
39 … | +```c | |
40 … | +int pngspark_write(struct pngspark *ps, FILE *file); | |
41 … | +``` | |
42 … | +Process the values and write as a PNG to a file. | |
43 … | + | |
44 … | +```c | |
45 … | +int pngspark_end(struct pngspark *ps); | |
46 … | +``` | |
47 … | +Release allocated memory for the pngspark. (Does not free `ps`, however). | |
48 … | + | |
49 … | +# License | |
50 … | + | |
51 … | +MIT |
Built with git-ssb-web