NCEPLIBS-g2c  1.6.4
pngunpack.c File Reference

Contains a function to unpack data packed with PNG compression. More...

#include <stdio.h>
#include <stdlib.h>
#include "grib2.h"

Go to the source code of this file.

Functions

int dec_png (unsigned char *, g2int *, g2int *, char *)
 Decode PNG. More...
 
g2int pngunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld)
 This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010. More...
 

Detailed Description

Contains a function to unpack data packed with PNG compression.

Author
Stephen Gilbert
Date
2003-08-27

Definition in file pngunpack.c.

Function Documentation

◆ dec_png()

int dec_png ( unsigned char *  pngbuf,
g2int width,
g2int height,
char *  cout 
)

Decode PNG.

Parameters
pngbufPointer to PNG buffer.
widthPointer to width.
heightPointer to height.
coutOutput buffer.
Returns
0 for success, error code otherwise.
Author
Stephen Gilbert

Definition at line 71 of file dec_png.c.

References user_read_data().

Referenced by pngunpack().

◆ pngunpack()

g2int pngunpack ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
g2float fld 
)

This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.41 or 5.40010.

Parameters
cpackThe packed data field (character*1 array).
lenlength of packed field cpack().
idrstmplPointer to array of values for Data Representation Template 5.41 or 5.40010.
ndptsThe number of data values to unpack.
fldContains the unpacked data values.
Returns
0 for success, 1 for memory allocation error.
Author
Stephen Gilbert
Date
2003-08-27

Definition at line 30 of file pngunpack.c.

References dec_png(), gbits(), int_power(), and rdieee().

Referenced by g2_unpack7().