NCEPLIBS-g2c  1.6.4
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.h"

Go to the source code of this file.

Functions

int dec_jpeg2000 (char *, g2int, g2int *)
 This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software written by the University of British Columbia and Image Power Inc, and others. More...
 
g2int jpcunpack (unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts, g2float *fld)
 This subroutine unpacks a data field that was packed into a JPEG2000 code stream 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

◆ dec_jpeg2000()

int dec_jpeg2000 ( char *  injpc,
g2int  bufsize,
g2int outfld 
)

This Function decodes a JPEG2000 code stream specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer Software written by the University of British Columbia and Image Power Inc, and others.

JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.

Parameters
injpcInput JPEG2000 code stream.
bufsizeLength (in bytes) of the input JPEG2000 code stream.
outfldOutput matrix of grayscale image values.
Returns
  • 0 Successful decode
  • -3 Error decode jpeg2000 code stream.
  • -5 decoded image had multiple color components. Only grayscale is expected.
Author
Stephen Gilbert
Date
2002-12-02

Definition at line 42 of file dec_jpeg2000.c.

Referenced by jpcunpack().

◆ jpcunpack()

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

This subroutine unpacks a data field that was packed into a JPEG2000 code stream using info from the GRIB2 Data Representation Template 5.40 or 5.40000.

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

Definition at line 31 of file jpcunpack.c.

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

Referenced by g2_unpack7().