Applications/Libpng

From HPC
Revision as of 09:16, 17 March 2017 by Pysdlb (talk | contribs)

Jump to: navigation , search

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:

  1. 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;
  ...



gcc -o makePNG makePNG.c -lm -lpng 



Further Information

http://www.libpng.org