GithubHelp home page GithubHelp logo

malyjacob / lodepng Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lvandeve/lodepng

0.0 0.0 0.0 2.11 MB

PNG encoder and decoder in C and C++.

License: zlib License

C++ 99.87% Makefile 0.13%

lodepng's Introduction

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

lodepng's People

Contributors

lvandeve avatar slowriot avatar sezero avatar iamarshsingh avatar bobsayshilol avatar jayxon avatar hohmiyazawa avatar ngaishunchan avatar saribro avatar jobtalle avatar dennisosrm avatar benwiederhake avatar vitalybuka avatar rholais avatar jesin avatar jeckdev avatar hpjansson avatar ewouth avatar cosinekitty avatar flameeyes avatar bpfoley avatar amirgon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.