NCEPLIBS-g2c
1.6.4
|
Function to pack data with PNG compression. More...
Go to the source code of this file.
Functions | |
int | enc_png (char *, g2int, g2int, g2int, char *) |
Encode PNG. More... | |
void | pngpack (g2float *fld, g2int width, g2int height, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack) |
This subroutine packs up a data field into PNG image format. More... | |
Encode PNG.
data | data. |
width | width. |
height | height. |
nbits | number of bits. |
pngbuf | PNG buffer. |
Definition at line 81 of file enc_png.c.
References user_flush_data(), and user_write_data().
Referenced by pngpack().
void pngpack | ( | g2float * | fld, |
g2int | width, | ||
g2int | height, | ||
g2int * | idrstmpl, | ||
unsigned char * | cpack, | ||
g2int * | lcpack | ||
) |
This subroutine packs up a 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 | 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 38 of file pngpack.c.
References enc_png(), int_power(), mkieee(), and sbits().
Referenced by g2_addfield().