jpcpack.c(3) | Library Functions Manual | jpcpack.c(3) |
jpcpack.c - Pack and unpack an array of float/double using JPEG2000.
#include 'grib2_int.h'
#include <math.h>
#include <stdlib.h>
int g2c_jpcpackd (double *fld, size_t width, size_t height,
int *idrstmpl, unsigned char *cpack, size_t *lcpack)
This function packs up a double array into a JPEG2000 code stream. int
g2c_jpcpackf (float *fld, size_t width, size_t height, int *idrstmpl,
unsigned char *cpack, size_t *lcpack)
This function packs up a float array into a JPEG2000 code stream. void
jpcpack (float *fld, g2int width, g2int height,
g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)
This function packs up a float array into a JPEG2000 code stream. static int
jpcpack_int (void *fld, int fld_is_double, g2int width,
g2int height, g2int *idrstmpl, unsigned char *cpack,
g2int *lcpack, int verbose)
Packs a float or double array into a JPEG2000 code stream.
Pack and unpack an array of float/double using JPEG2000.
Author
Date
Date Programmer Comments 2003-08-17 Gilbert Initial. 2004-11-92 Gilbert Fixed bug packing a near constant field. 2004-07-19 Gilbert If jpeg2000 encoding fails, try again with different encoder options. 2005-05-10 Gilbert Imposed minimum size on cpack. 2022-08-12 Hartnett Now handle doubles too.
Definition in file jpcpack.c.
This function packs up a double array into a JPEG2000 code stream. After the data are scaled, and the reference value is subtracted out, the data are treated as a grayscale image and passed to a JPEG2000 encoder.
This function also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
This function is the V2 API version of jpcpack() for doubles.
Parameters
cpack A pointer that will get the packed data field. Must
be allocated before this function is called. Pass the allocated size in the
lcpack parameter.
lcpack Pointer that gets the length of packed field in cpack. This must
be set by the calling function to the size available in cpack.
Returns
Author
Definition at line 386 of file jpcpack.c.
References G2C_JPEG_DRS_TEMPLATE_LEN, and jpcpack_int().
This function packs up a float array into a JPEG2000 code stream. After the data are scaled, and the reference value is subtracted out, the data are treated as a grayscale image and passed to a JPEG2000 encoder.
This function also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
This function is the V2 API version of jpcpack() for floats.
Parameters
cpack A pointer that will get the packed data field. Must
be allocated before this function is called. Pass the allocated size in the
lcpack parameter.
lcpack Pointer that gets the length of packed field in cpack. This must
be set by the calling function to the size available in cpack.
Returns
Author
Definition at line 320 of file jpcpack.c.
References G2C_JPEG_DRS_TEMPLATE_LEN, and jpcpack_int().
This function packs up a float array into a JPEG2000 code stream. After the data are scaled, and the reference value is subtracted out, the data are treated as a grayscale image and passed to a JPEG2000 encoder.
This function also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
Parameters
cpack A pointer that will get the packed data field. Must
be allocated before this function is called. Pass the allocated size in the
lcpack parameter.
lcpack Pointer that gets the length of packed field in cpack. This must
be set by the calling function to the size available in cpack.
Author
Definition at line 269 of file jpcpack.c.
References jpcpack_int().
Referenced by g2_addfield().
Packs a float or double array into a JPEG2000 code stream. This function is used by jpcpack(), g2c_jpcpackf(), and g2c_jpcpackd().
Parameters
Returns
Author
Definition at line 54 of file jpcpack.c.
References ALOG2, enc_jpeg2000(), G2C_EJPEG, G2C_NOERROR, int_power(), LOG, mkieee(), and sbits().
Referenced by g2c_jpcpackd(), g2c_jpcpackf(), and jpcpack().
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
Version 2.1.0 | NCEPLIBS-g2c |