NCEPLIBS-g2  3.4.5
enc_png.c File Reference

This program writes PNG stream to memory. More...

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

Go to the source code of this file.

Typedefs

typedef long g2int
 Long integer type. More...
 
typedef struct png_stream png_stream
 location to write PNG stream. More...
 

Functions

int SUB_NAME (char *data, g2int *width, g2int *height, g2int *nbits, char *pngbuf)
 create png_structs to write png stream into memory. More...
 
void user_flush_data (png_structp png_ptr)
 Dummy Custom flush function. More...
 
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. More...
 

Detailed Description

This program writes PNG stream to memory.

Author
Stephen Gilbert

Definition in file enc_png.c.

Typedef Documentation

◆ g2int

typedef long g2int

Long integer type.

Definition at line 15 of file enc_png.c.

◆ png_stream

typedef struct png_stream png_stream

location to write PNG stream.

Definition at line 43 of file enc_png.c.

Function Documentation

◆ SUB_NAME()

int SUB_NAME ( char *  data,
g2int width,
g2int height,
g2int nbits,
char *  pngbuf 
)

create png_structs to write png stream into memory.

Parameters
datadata.
widthwidth.
heightheight.
nbitsnumber of bits.
pngbufPNG buffer.
Returns
pnglen the length of png stream
Author
Stephen Gilbert

Definition at line 102 of file enc_png.c.

◆ user_flush_data()

void user_flush_data ( png_structp  png_ptr)

Dummy Custom flush function.

Parameters
png_ptrPointer to PNG struct.
Author
Stephen Gilbert

Definition at line 83 of file enc_png.c.

◆ user_write_data()

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.

Parameters
png_ptrpointer
datadata
lengthlength
Author
Stephen Gilbert

Definition at line 59 of file enc_png.c.