Dillo v3.1.1-119-g140d9ebd
|
The png decoder for Dillo. More...
#include <config.h>
#include <stdlib.h>
#include <png.h>
#include "msg.h"
#include "image.hh"
#include "cache.h"
#include "dicache.h"
Go to the source code of this file.
Macros | |
#define | DATASIZE (png->ipbufsize - png->ipbufstart) |
Enumerations | |
enum | prog_state { IS_finished , IS_init , IS_nextdata } |
Functions | |
static void | Png_error_handling (png_structp png_ptr, png_const_charp msg) |
static void | Png_warning_handler (png_structp png_ptr, png_const_charp msg) |
static void | Png_datainfo_callback (png_structp png_ptr, png_infop info_ptr) |
static void | Png_datarow_callback (png_structp png_ptr, png_bytep new_row, png_uint_32 row_num, int pass) |
static void | Png_dataend_callback (png_structp png_ptr, png_infop info_ptr) |
static void | Png_free (DilloPng *png) |
Free up the resources for this image. | |
static void | Png_close (DilloPng *png, CacheClient_t *Client) |
Finish the decoding process (and free the memory) | |
static void | Png_write (DilloPng *png, void *Buf, uint_t BufSize) |
Receive and process new chunks of PNG image data. | |
void | a_Png_callback (int Op, void *data) |
PNG callback. | |
const char * | a_Png_version (void) |
void * | a_Png_new (DilloImage *Image, DilloUrl *url, int version) |
Create the image state data that must be kept between calls. | |
The png decoder for Dillo.
It is responsible for decoding PNG data and transferring it to the dicache.
"PNG: The Definitive Guide" by Greg Roelofs, O'Reilly ISBN 1-56592-542-4
Definition in file png.c.
enum prog_state |
void a_Png_callback | ( | int | Op, |
void * | data | ||
) |
PNG callback.
You have to keep track of where you are in the image data and how much has been processed.
It's entirely possible that you will not see the end of the data. The user may terminate transfer via a Stop button or there may be a network failure. This means that you can't just wait for all the data to be presented before starting conversion and display.
Definition at line 427 of file png.c.
References CacheClient::Buf, CacheClient::BufSize, CA_Abort, CA_Close, CA_Send, CacheClient::CbData, Png_close(), Png_free(), and Png_write().
void * a_Png_new | ( | DilloImage * | Image, |
DilloUrl * | url, | ||
int | version | ||
) |
Create the image state data that must be kept between calls.
Definition at line 448 of file png.c.
References _MSG, _DilloImage::bg_color, dNew0, and IS_init.
Referenced by Dicache_image().
const char * a_Png_version | ( | void | ) |
Definition at line 440 of file png.c.
Referenced by print_libs().
|
static |
Finish the decoding process (and free the memory)
Definition at line 327 of file png.c.
References _MSG, a_Dicache_close(), and Png_free().
Referenced by a_Png_callback().
|
static |
Definition at line 295 of file png.c.
References _MSG, IS_finished, and MSG.
Referenced by Png_write().
|
static |
Definition at line 128 of file png.c.
References _MSG, a_Dicache_set_parms(), DILLO_IMG_TYPE_RGB, dMalloc(), dReturn_if_fail, IMAGE_MAX_AREA, MSG, and Png_error_handling().
Referenced by Png_write().
|
static |
Definition at line 224 of file png.c.
References _MSG, a_Dicache_new_scan(), a_Dicache_write(), and MSG.
Referenced by Png_write().
|
static |
Definition at line 105 of file png.c.
References IS_finished, MSG, and URL_STR.
Referenced by Png_datainfo_callback(), and Png_write().
|
static |
Free up the resources for this image.
Definition at line 310 of file png.c.
References _MSG, dFree(), and MSG_WARN.
Referenced by a_Png_callback(), and Png_close().
|
static |
|
static |
Receive and process new chunks of PNG image data.
Definition at line 338 of file png.c.
References _MSG, DATASIZE, dReturn_if_fail, IS_finished, IS_init, IS_nextdata, MSG_WARN, Png_dataend_callback(), Png_datainfo_callback(), Png_datarow_callback(), Png_error_handling(), Png_warning_handler(), and URL_STR.
Referenced by a_Png_callback().