NCEPLIBS-g2
3.5.0
|
Pack/unpack a data field into PNG image format, defined in Data Representation Template 5.40. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | pngpack (fld, width, height, idrstmpl, cpack, lcpack) |
Pack a data field into PNG image format, defined in [Data Representation Template 5.41](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-41.shtml). More... | |
subroutine | pngunpack (cpack, len, idrstmpl, ndpts, fld) |
Unpack a data field with PNG, defined in [Data Representation Template 5.40](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-40.shtml). More... | |
Pack/unpack a data field into PNG image format, defined in Data Representation Template 5.40.
Definition in file g2png.F90.
subroutine pngpack | ( | real, dimension(width * height), intent(in) | fld, |
integer, intent(in) | width, | ||
integer, intent(in) | height, | ||
integer, dimension(*), intent(inout) | idrstmpl, | ||
character(len = 1), dimension(*), intent(out) | cpack, | ||
integer, intent(out) | lcpack | ||
) |
Pack a data field into PNG image format, defined in [Data Representation Template 5.41](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-41.shtml).
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.
[in] | fld | Contains the data values to pack. |
[in] | width | number of points in the x direction. |
[in] | height | number of points in the y direction. |
[in,out] | idrstmpl | Contains the array of values for Data Representation Template 5.2 or 5.3.
|
[out] | cpack | The packed data field (character*1 array) |
[out] | lcpack | The length of packed field cpack. |
Definition at line 33 of file g2png.F90.
References enc_png(), g2_sbytesc(), and mkieee().
Referenced by addfield().
subroutine pngunpack | ( | character(len = 1), dimension(len), intent(in) | cpack, |
integer, intent(in) | len, | ||
integer, dimension(*), intent(in) | idrstmpl, | ||
integer, intent(in) | ndpts, | ||
real, dimension(ndpts), intent(out) | fld | ||
) |
Unpack a data field with PNG, defined in [Data Representation Template 5.40](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-40.shtml).
This subroutine unpacks a data field that was packed into a PNG image format using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
[in] | cpack | The packed data field (character*1 array). |
[in] | len | length of packed field cpack(). |
[in] | idrstmpl | Contains the array of values for Data Representation Template 5.40 or 5.40000. |
[in] | ndpts | The number of data values to unpack. |
[out] | fld | Contains the unpacked data values. |
Definition at line 167 of file g2png.F90.
References dec_png(), g2_gbytesc(), and rdieee().
Referenced by getfield(), and gf_unpack7().