Applications/Libpng
From HPC
Application Details
- Description: libpng is the official PNG reference library. It supports almost all PNG features, this module would be used for application that require png image support..
- Version: 1.6.25
- Module: 1.6.25
- Licence: GNU
Usage Examples
Module
[username@login01 ~]$ module add libpng/1.6.25
Compilation
Libpng is a library for use either with a compiled binary that requires it, or it could be required at compilation time also.
A typical code snippet requiring is shown below:
#include <png.h> ... int writeImage(char* filename, int width, int height, float *buffer, char* title) { int code = 0; FILE *fp = NULL; png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_bytep row = NULL; ...
Compilation is carried out below, in this example the gcc compiler is used. However, the applies similarly to the Intel compiler too.
gcc -o makePNG makePNG.c -lm -lpng