NCEPLIBS-g2c
1.7.0
|
Function to pack data with PNG compression. More...
Go to the source code of this file.
Functions | |
void | pngpack (float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
This subroutine packs up a float data field into PNG image format. More... | |
static void | pngpack_int (void *fld, int fld_is_double, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
This internal function packs up float or double data into PNG image format. More... | |
void | pngpackd (double *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
This subroutine packs up a double data field into PNG image format. More... | |
void pngpack | ( | float * | fld, |
g2int | width, | ||
g2int | height, | ||
g2int * | idrstmpl, | ||
unsigned char * | cpack, | ||
g2int * | lcpack | ||
) |
This subroutine packs up a float data field into PNG image format.
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
fld | Pointer to array of float that contains the data values to pack. |
width | Number of points in the x direction. |
height | Number of points in the y direction. |
idrstmpl | Contains the array of values for Data Representation Template 5.41 or 5.40010.
|
cpack | The packed data field. |
lcpack | length of packed field cpack. |
Definition at line 224 of file pngpack.c.
References pngpack_int().
Referenced by g2_addfield().
|
static |
This internal function packs up float or double data into PNG image format.
This is called by pngpack() and pngpackd().
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
fld | Pointer to array of float or double that contains the data values to pack. |
fld_is_double | If non-zero, then fld is double, otherwise float. |
width | Number of points in the x direction. |
height | Number of points in the y direction. |
idrstmpl | Contains the array of values for Data Representation Template 5.41 or 5.40010.
|
cpack | The packed data field. |
lcpack | length of packed field cpack. |
Definition at line 41 of file pngpack.c.
References ALOG2, enc_png(), int_power(), LOG, mkieee(), and sbits().
Referenced by pngpack(), and pngpackd().
void pngpackd | ( | double * | fld, |
g2int | width, | ||
g2int | height, | ||
g2int * | idrstmpl, | ||
unsigned char * | cpack, | ||
g2int * | lcpack | ||
) |
This subroutine packs up a double data field into PNG image format.
After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a PNG encoder. It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with the appropriate values.
fld | Pointer to array of double that contains the data values to pack. |
width | Number of points in the x direction. |
height | Number of points in the y direction. |
idrstmpl | Contains the array of values for Data Representation Template 5.41 or 5.40010.
|
cpack | The packed data field. |
lcpack | length of packed field cpack. |
Definition at line 259 of file pngpack.c.
References pngpack_int().