Difference between revisions of "Applications/Libpng"

From HPC
Jump to: navigation , search
m (Pysdlb moved page Libpng to Applications/Libpng without leaving a redirect)
m
Line 7: Line 7:
  
 
==Usage Examples==
 
==Usage Examples==
 +
 
===Module===
 
===Module===
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
[username@login01 ~]$ module add libpng/1.6.25
 
[username@login01 ~]$ module add libpng/1.6.25
 
</pre>
 
</pre>
 +
 +
===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;
 +
  ...
 +
 +
 +
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 +
 +
gcc -o makePNG makePNG.c -lm -lpng
 +
 +
</pre>
 +
 +
 +
 +
  
 
==Further Information==
 
==Further Information==
  
 
[http://www.libpng.org/ http://www.libpng.org]
 
[http://www.libpng.org/ http://www.libpng.org]

Revision as of 09:16, 17 March 2017

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