NCEPLIBS-g2c  1.7.0
jpcunpack.c File Reference

Unpack a data field that was packed into a JPEG2000 code stream. More...

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

Go to the source code of this file.

Functions

g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, float *fld)
 Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
 
static g2int jpcunpack_int (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, void *fld, int fld_is_double)
 Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
 
g2int jpcunpackd (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, double *fld)
 Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000. More...
 

Detailed Description

Unpack a data field that was packed into a JPEG2000 code stream.

Author
Stephem Gilbert
Date
2003-08-27

Definition in file jpcunpack.c.

Function Documentation

◆ jpcunpack()

g2int jpcunpack ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
float *  fld 
)

Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

Parameters
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA pointer that gets the unpacked data values as an array of float.
Returns
0 for success, 1 for memory allocation error.
Author
Stephem Gilbert
Date
2003-08-27
Author
Ed Hartnett

Definition at line 108 of file jpcunpack.c.

References jpcunpack_int().

Referenced by g2_unpack7().

◆ jpcunpack_int()

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

Unpack JPEG2000 compressed data into an array of floats, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

Parameters
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA pointer that gets the unpacked data values.
fld_is_doubleNon-zero if the data are to be unpacked into a double array, otherwise data will be unpacked into a float array.
Returns
0 for success, 1 for memory allocation error.
Author
Stephem Gilbert
Date
2003-08-27
Author
Ed Hartnett

Definition at line 33 of file jpcunpack.c.

References dec_jpeg2000(), G2_JPCUNPACK_MEM, G2_NO_ERROR, int_power(), and rdieee().

Referenced by jpcunpack(), and jpcunpackd().

◆ jpcunpackd()

g2int jpcunpackd ( unsigned char *  cpack,
g2int  len,
g2int idrstmpl,
g2int  ndpts,
double *  fld 
)

Unpack JPEG2000 compressed data into an array of doubles, using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

Parameters
cpackThe packed data.
lenThe length of the packed data.
idrstmplPointer to array of values for Data Representation Template 5.40 or 5.40000.
ndptsThe number of data values to unpack.
fldA pointer that gets the unpacked data values as an array of double.
Returns
0 for success, 1 for memory allocation error.
Author
Ed Hartnett
Date
2022-08-12

Definition at line 135 of file jpcunpack.c.

References jpcunpack_int().