.TH "pngpack.c" 3 "Fri Jun 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME pngpack.c .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "int \fBenc_png\fP (char *, \fBg2int\fP, \fBg2int\fP, \fBg2int\fP, char *)" .br .RI "Encode PNG\&. " .ti -1c .RI "void \fBpngpack\fP (\fBg2float\fP *fld, \fBg2int\fP width, \fBg2int\fP height, \fBg2int\fP *idrstmpl, unsigned char *cpack, \fBg2int\fP *lcpack)" .br .RI "This subroutine packs up a data field into PNG image format\&. " .in -1c .SH "Detailed Description" .PP .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2003-08-27 .RE .PP .PP Definition in file \fBpngpack\&.c\fP\&. .SH "Function Documentation" .PP .SS "int enc_png (char * data, \fBg2int\fP width, \fBg2int\fP height, \fBg2int\fP nbits, char * pngbuf)" .PP Encode PNG\&. .PP \fBParameters\fP .RS 4 \fIdata\fP data\&. .br \fIwidth\fP width\&. .br \fIheight\fP height\&. .br \fInbits\fP number of bits\&. .br \fIpngbuf\fP PNG buffer\&. .RE .PP \fBReturns\fP .RS 4 PNG length, or negative number for error\&. .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP .PP Definition at line 81 of file enc_png\&.c\&. .PP References user_flush_data(), and user_write_data()\&. .PP Referenced by pngpack()\&. .SS "void pngpack (\fBg2float\fP * fld, \fBg2int\fP width, \fBg2int\fP height, \fBg2int\fP * idrstmpl, unsigned char * cpack, \fBg2int\fP * lcpack)" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIfld\fP Contains the data values to pack\&. .br \fIwidth\fP number of points in the x direction\&. .br \fIheight\fP number of points in the y direction\&. .br \fIidrstmpl\fP Contains the array of values for Data Representation Template 5\&.41 or 5\&.40010\&. .IP "\(bu" 2 0 Reference value - ignored on input, set by pngpack routine\&. .IP "\(bu" 2 1 Binary Scale Factor - used on input\&. .IP "\(bu" 2 2 Decimal Scale Factor - used on input\&. .IP "\(bu" 2 3 number of bits for each grayscale pixel value - ignored on input\&. .IP "\(bu" 2 4 Original field type - currently ignored on input, set = 0 on output\&. Data values assumed to be reals\&. .PP .br \fIcpack\fP The packed data field\&. .br \fIlcpack\fP length of packed field cpack\&. .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2003-08-27 .RE .PP .PP Definition at line 34 of file pngpack\&.c\&. .PP References enc_png(), int_power(), mkieee(), and sbits()\&. .PP Referenced by g2_addfield()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.