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

Data Structures

struct  onion_png_data_t


typedef struct onion_png_data_t onion_png_data


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

Typedef Documentation

Function Documentation

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

Writes an image as png to the 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.