All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
png.h File Reference
#include <onion/types.h>


int onion_png_response (unsigned char *image, int Bpp, int width, int height, onion_response *res)
 Writes an image data to a response object.

Function Documentation

int onion_png_response ( unsigned char *  image,
int  Bpp,
int  width,
int  height,
onion_response res 

Writes an image data to a response object.

Writes an image data to a response object.

imageflat buffer with all pixels
BppBytes per pixel: 1 grayscale, 2 grayscale with alpha, 3 RGB, 4 RGB with alpha. Negative if in BGR format (cairo)
widthThe width of the image
heightThe height of the image
reswhere to write the image, it sets the necessary structs

References OCS_INTERNAL_ERROR, OCS_PROCESSED, onion_response_t::onion_response_set_header(), onion_response_t::onion_response_write_headers(), OR_SKIP_CONTENT, onion_png_data_t::res, and onion_png_data_t::sent.