lodepng

PNG encoder and decoder in C and C++.

  • 所有者: lvandeve/lodepng
  • 平台:
  • 許可證: zlib License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

LodePNG

PNG encoder and decoder in C and C++, without dependencies

Home page: http://lodev.org/lodepng/

Documentation

Detailed documentation is included in a large comment in the second half of the
header file lodepng.h.

Source code examples using LodePNG can be found in the examples directory.

An FAQ can be found on http://lodev.org/lodepng/

Building

Only two files are needed to encode and decode PNGs:

  • lodepng.cpp (or renamed to lodepng.c)
  • lodepng.h

All other files are just source code examples, tests, misc utilities, etc...,
which are normally not needed in projects using this.

You can include the files directly in your project's source tree and its
makefile, IDE project file, or other build system. No library is necessary.

In addition to C++, LodePNG also supports ANSI C (C89), with all the same
functionality: C++ only adds extra convenience API.

For C, rename lodepng.cpp to lodepng.c.

Consider using git submodules to include LodePNG in your project.

Compiling in C++

If you have a hypothetical your_program.cpp that #includes and uses lodepng.h,
you can build as follows:

g++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3

or:

clang++ your_program.cpp lodepng.cpp -Wall -Wextra -pedantic -ansi -O3

This shows compiler flags it was designed for, but normally one would use the
compiler or build system of their project instead of those commands, and other
C++ compilers are supported.

Compiling in C

Rename lodepng.cpp to lodepng.c for this.

If you have a hypothetical your_program.c that #includes and uses lodepng.h,
you can build as follows:

gcc your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3

or

clang your_program.c lodepng.c -ansi -pedantic -Wall -Wextra -O3

This shows compiler flags it was designed for, but normally one would use the
compiler or build system of their project instead of those commands, and other
C compilers are supported.

Makefile

There is a Makefile, but this is not intended for using LodePNG itself since the
way to use that one is to include its source files in your program. The Makefile
only builds development and testing utilities. It can be used as follows:

make -j

主要指標

概覽
名稱與所有者lvandeve/lodepng
主編程語言C++
編程語言C++ (語言數: 2)
平台
許可證zlib License
所有者活动
創建於2014-08-23 23:37:50
推送於2025-07-01 21:42:28
最后一次提交2025-07-01 23:42:28
發布數0
用户参与
星數2.2k
關注者數78
派生數443
提交數248
已啟用問題?
問題數129
打開的問題數63
拉請求數34
打開的拉請求數29
關閉的拉請求數20
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?