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

..03-May-2022-

examples/H15-Feb-2020-1,858905

LICENSEH A D15-Feb-2020886 2215

MakefileH A D15-Feb-20201.1 KiB3518

README.mdH A D15-Feb-20202.2 KiB7645

lodepng.cppH A D15-Feb-2020253.4 KiB6,3994,723

lodepng.hH A D15-Feb-202091.5 KiB1,946431

lodepng_benchmark.cppH A D15-Feb-202013.5 KiB351240

lodepng_fuzzer.cppH A D15-Feb-20203.1 KiB9545

lodepng_unittest.cppH A D15-Feb-2020302.5 KiB3,7012,932

lodepng_util.cppH A D15-Feb-202071 KiB1,7661,369

lodepng_util.hH A D15-Feb-202013.4 KiB29166

pngdetail.cppH A D15-Feb-202054.2 KiB1,4111,187

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 renamed to `lodepng.c`)
22* `lodepng.h`
23
24All other files are just source code examples, tests, misc utilities, etc...,
25which are 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### Compiling in C++
38
39If you have a hypothetical `your_program.cpp` that #includes and uses `lodepng.h`,
40you can build as follows:
41
42`g++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3`
43
44or:
45
46`clang++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3`
47
48This shows compiler flags it was designed for, but normally one would use the
49compiler or build system of their project instead of those commands, and other
50C++ compilers are supported.
51
52### Compiling in C
53
54Rename `lodepng.cpp` to `lodepng.c` for this.
55
56If you have a hypothetical your_program.c that #includes and uses lodepng.h,
57you can build as follows:
58
59`gcc your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3`
60
61or
62
63`clang your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3`
64
65This shows compiler flags it was designed for, but normally one would use the
66compiler or build system of their project instead of those commands, and other
67C compilers are supported.
68
69### Makefile
70
71There is a Makefile, but this is not intended for using LodePNG itself since the
72way to use that one is to include its source files in your program. The Makefile
73only builds development and testing utilities. It can be used as follows:
74
75`make -j`
76