table of contents
pngpack.c(3) | NCEPLIBS-g2c | pngpack.c(3) |
NAME¶
pngpack.c
SYNOPSIS¶
#include <stdlib.h>
#include <math.h>
#include 'grib2.h'
Functions¶
int enc_png (char *, g2int, g2int,
g2int, char *)
Encode PNG. 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.
Detailed Description¶
Author
Date
Definition in file pngpack.c.
Function Documentation¶
int enc_png (char * data, g2int width, g2int height, g2int nbits, char * pngbuf)¶
Encode PNG.
Parameters
width width.
height height.
nbits number of bits.
pngbuf PNG buffer.
Returns
Author
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.
Parameters
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.
- 0 Reference value - ignored on input, set by pngpack routine.
- 1 Binary Scale Factor - used on input.
- 2 Decimal Scale Factor - used on input.
- 3 number of bits for each grayscale pixel value - ignored on input.
- 4 Original field type - currently ignored on input, set = 0 on output. Data values assumed to be reals.
cpack The packed data field.
lcpack length of packed field cpack.
Author
Date
Definition at line 34 of file pngpack.c.
References enc_png(), int_power(), mkieee(), and sbits().
Referenced by g2_addfield().
Author¶
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
Tue May 3 2022 | Version 1.6.4 |