logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

decenc_png.c - Decode/encode a PNG stream.

Author

       Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.

NCEPLIBS-g2c                                      Version 2.1.0                                  decenc_png.c(3)

Detailed Description

       Decode/encode a PNG stream.

       Author
           Alyson Stahl

       Date
           2024-13-08

       Definition in file decenc_png.c.

Function Documentation

intdec_png(unsignedchar*pngbuf,g2int*width,g2int*height,unsignedchar*cout)
       Decode PNG.

       Parameterspngbuf Pointer to PNG buffer.
           width Pointer to width.
           height Pointer to height.
           cout Output buffer.

       Returns
           0 for success, error code otherwise.

       Author
           Stephen Gilbert

       Definition at line 127 of file decenc_png.c.

       References G2C_PNG_HEIGHT_MAX, G2C_PNG_WIDTH_MAX, and user_read_data().

       Referenced by g2c_dec_png(), and pngunpack_int().

   intenc_png(unsignedchar*data,g2intwidth,g2intheight,g2intnbits,unsignedchar*pngbuf)
       Encode PNG.

       Parametersdata data.
           width width.
           height height.
           nbits number of bits.
           pngbuf PNG buffer.

       Returns
           PNG length, or negative number for error.

       Author
           Stephen Gilbert

       Definition at line 259 of file decenc_png.c.

       References user_flush_data(), and user_write_data().

       Referenced by g2c_enc_png(), and pngpack_int().

   intg2c_dec_png(unsignedchar*pngbuf,int*width,int*height,unsignedchar*cout)
       Decode PNG.

       Parameterspngbuf Pointer to PNG buffer.
           width Pointer to width.
           height Pointer to height.
           cout Output buffer.

       Returns
           0 for success, error code otherwise.

       Author
           Alyson Stahl

       Definition at line 100 of file decenc_png.c.

       References dec_png().

   intg2c_enc_png(unsignedchar*data,intwidth,intheight,intnbits,unsignedchar*pngbuf)
       Encode PNG.

       Parametersdata data.
           width width.
           height height.
           nbits number of bits.
           pngbuf PNG buffer.

       Returns
           PNG length, or negative number for error.

       Author
           Alyson Stahl

       Definition at line 237 of file decenc_png.c.

       References enc_png().

   voiduser_flush_data(png_structppng_ptr)
       Dummy Custom flush function.

       Parameterspng_ptr Pointer to PNG struct.

       Author
           Stephen Gilbert

       Definition at line 83 of file decenc_png.c.

       Referenced by enc_png().

   voiduser_read_data(png_structppng_ptr,png_bytepdata,png_uint_32length)
       Custom read function used so that libpng will read a PNG stream from memory instead of a file on disk.

       Parameterspng_ptr Pointer to PNG.
           data Pointer to data.
           length Length.

       Author
           Stephen Gilbert

       Definition at line 38 of file decenc_png.c.

       Referenced by dec_png().

   voiduser_write_data(png_structppng_ptr,png_bytepdata,png_uint_32length)
       Custom write function used to that libpng will write to memory location instead of a file on disk.

       Parameterspng_ptr pointer
           data data
           length length

       Author
           Stephen Gilbert

       Definition at line 62 of file decenc_png.c.

       Referenced by enc_png().

Name

       decenc_png.c - Decode/encode a PNG stream.

Synopsis

       #include 'grib2_int.h'
       #include <png.h>
       #include <stdio.h>
       #include <stdlib.h>
       #include <string.h>

   Typedefs
       typedef struct png_stream png_stream
           Typedef for PNG stream.

   Functions
       int dec_png (unsigned char *pngbuf, g2int *width, g2int *height, unsigned char *cout)
           Decode PNG.
       int enc_png (unsigned char *data, g2int width, g2int height, g2int nbits, unsigned char *pngbuf)
           Encode PNG.
       int g2c_dec_png (unsigned char *pngbuf, int *width, int *height, unsigned char *cout)
           Decode PNG.
       int g2c_enc_png (unsigned char *data, int width, int height, int nbits, unsigned char *pngbuf)
           Encode PNG.
       void user_flush_data (png_structp png_ptr)
           Dummy Custom flush function.
       void user_read_data (png_structp png_ptr, png_bytep data, png_uint_32 length)
           Custom read function used so that libpng will read a PNG stream from memory instead of a file on
           disk.
       void user_write_data (png_structp png_ptr, png_bytep data, png_uint_32 length)
           Custom write function used to that libpng will write to memory location instead of a file on disk.

Typedef Documentation

typedefstructpng_streampng_stream
       Typedef for PNG stream.

       Definition at line 21 of file decenc_png.c.

See Also