Dillo v3.1.1-98-g318d1f14
|
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. | |
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 426 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 442 of file png.c.
References _MSG, _DilloImage::bg_color, dNew0, and IS_init.
Referenced by Dicache_image().
|
static |
Finish the decoding process (and free the memory)
Definition at line 326 of file png.c.
References _MSG, a_Dicache_close(), and Png_free().
Referenced by a_Png_callback().
|
static |
Definition at line 294 of file png.c.
References _MSG, IS_finished, and MSG.
Referenced by Png_write().
|
static |
Definition at line 127 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 223 of file png.c.
References _MSG, a_Dicache_new_scan(), a_Dicache_write(), and MSG.
Referenced by Png_write().
|
static |
Definition at line 104 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 309 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 337 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().