|
NCEPLIBS-g2c
1.7.0
|
Pack up a data field into a JPEG2000 code stream. More...
Go to the source code of this file.
Functions | |
| void | jpcpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
| This subroutine packs up a data field into a JPEG2000 code stream. More... | |
| static void | jpcpack_int (void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
| This subroutine packs up a float or double array into a JPEG2000 code stream. More... | |
| void | jpcpackd (double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
| This subroutine packs up a data field into a JPEG2000 code stream. More... | |
Pack up a data field into a JPEG2000 code stream.
| 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.
| void jpcpack | ( | float * | fld, |
| g2int | width, | ||
| g2int | height, | ||
| g2int * | idrstmpl, | ||
| unsigned char * | cpack, | ||
| g2int * | lcpack | ||
| ) |
This subroutine packs up a data field into a JPEG2000 code stream.
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
| fld | Pointer to the float or double data values to pack. |
| width | The number of points in the x direction. |
| height | The number of points in the y direction. |
| idrstmpl | Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
|
| 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. |
Definition at line 253 of file jpcpack.c.
References jpcpack_int().
Referenced by g2_addfield().
|
static |
This subroutine packs up a float or double array into a JPEG2000 code stream.
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
| fld | Pointer to the float or double data values to pack. |
| fld_is_double | If non-zero, then fld points to array of doubles, otherwise an array of floats. |
| width | The number of points in the x direction. |
| height | The number of points in the y direction. |
| idrstmpl | Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
|
| 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. |
Definition at line 57 of file jpcpack.c.
References ALOG2, enc_jpeg2000(), int_power(), LOG, mkieee(), and sbits().
Referenced by jpcpack(), and jpcpackd().
| void jpcpackd | ( | double * | fld, |
| g2int | width, | ||
| g2int | height, | ||
| g2int * | idrstmpl, | ||
| unsigned char * | cpack, | ||
| g2int * | lcpack | ||
| ) |
This subroutine packs up a data field into a JPEG2000 code stream.
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.
| fld | Pointer to the float or double data values to pack. |
| width | The number of points in the x direction. |
| height | The number of points in the y direction. |
| idrstmpl | Contains the array of values for Data Representation Template Table 5.40 or 5.40000.
|
| 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. |
Definition at line 294 of file jpcpack.c.
References jpcpack_int().