NCEPLIBS-g2c  1.7.0
pngunpack.c File Reference

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

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

Go to the source code of this file.

Functions

g2int pngunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *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...
 
static g2int pngunpack_int (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
 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...
 
g2int pngunpackd (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *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

◆ pngunpack()

g2int pngunpack ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
float *  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
Author
Ed Hartnett

Definition at line 105 of file pngunpack.c.

References pngunpack_int().

Referenced by g2_unpack7().

◆ pngunpack_int()

static g2int pngunpack_int ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
void *  fld,
int  fld_is_double 
)
static

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).
lenThe length 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.
fldPointer that will get the unpacked data values.
fld_is_doubleIf non-zero, then fld will get data as double, otherwise float.
Returns
0 for success, 1 for memory allocation error.
Author
Stephen Gilbert, Ed Hartnett
Date
Aug 8, 2022

Definition at line 32 of file pngunpack.c.

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

Referenced by pngunpack(), and pngunpackd().

◆ pngunpackd()

g2int pngunpackd ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
double *  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
Ed Hartnett
Date
Aug 8, 2022

Definition at line 128 of file pngunpack.c.

References pngunpack_int().