• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H06-Aug-2019-

LICENSEH A D06-Aug-2019886

MakefileH A D06-Aug-20191.1 KiB

README.mdH A D06-Aug-20191.8 KiB

lodepng.cppH A D06-Aug-2019236.7 KiB

lodepng.hH A D06-Aug-201992 KiB

lodepng_benchmark.cppH A D06-Aug-201913.5 KiB

lodepng_fuzzer.cppH A D06-Aug-20193.1 KiB

lodepng_unittest.cppH A D06-Aug-2019132.5 KiB

lodepng_util.cppH A D06-Aug-201967.6 KiB

lodepng_util.hH A D06-Aug-201913.4 KiB

pngdetail.cppH A D06-Aug-201954.2 KiB

README.md

1LodePNG
2-------
3
4PNG encoder and decoder in C and C++, without dependencies
5
6Home page: http://lodev.org/lodepng/
7
8### Documentation
9
10Detailed documentation is included in a large comment in the second half of the
11header file lodepng.h.
12
13Source code examples using LodePNG can be found in the examples directory.
14
15An FAQ can be found on http://lodev.org/lodepng/
16
17### Building
18
19Only two files are needed to encode and decode PNGs:
20
21* lodepng.cpp (or lodepng.c)
22* lodepng.h
23
24All other files are just source code examples, tests, misc utilities, etc..., which
25are normally not needed in projects using this.
26
27You can include the files directly in your project's source tree and its
28makefile, IDE project file, or other build system. No library is necessary.
29
30In addition to C++, LodePNG also supports ANSI C (C89), with all the same
31functionality: C++ only adds extra convenience API.
32
33For C, rename lodepng.cpp to lodepng.c.
34
35Consider using git submodules to include LodePNG in your project.
36
37### Building in C++
38
39If you have a hypothetical main.cpp that #includes and uses lodepng.h, you can build as follows:
40
41g++ main.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3
42
43or:
44
45clang++ main.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3
46
47This shows compiler flags it was designed for, but normally one would use the
48compiler or build system of their project instead of those commands, and other
49C++ compilers are supported.
50
51### Building in C
52
53Rename lodepng.cpp to lodepng.c for this.
54
55If you have a hypothetical main.c that #includes and uses lodepng.h, you can build as follows:
56
57gcc main.c lodepng.c -ansi -pedantic -Wall -Wextra -O3
58
59or
60
61clang main.c lodepng.c -ansi -pedantic -Wall -Wextra -O3
62
63This shows compiler flags it was designed for, but normally one would use the
64compiler or build system of their project instead of those commands, and other
65C compilers are supported.
66