NetSurf
|
implementation of content handling for image/webp More...
#include <stdbool.h>
#include <stdlib.h>
#include <setjmp.h>
#include <webp/decode.h>
#include "utils/utils.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/bitmap.h"
#include "content/llcache.h"
#include "content/content_protected.h"
#include "content/content_factory.h"
#include "desktop/gui_internal.h"
#include "desktop/bitmap.h"
#include "image/image_cache.h"
#include "webp.h"
Go to the source code of this file.
Functions | |
static nserror | webp_create (const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c) |
Content create entry point. More... | |
static struct bitmap * | webp_cache_convert (struct content *c) |
create a bitmap from webp content. More... | |
static bool | webp_convert (struct content *c) |
Convert the webp source data content. More... | |
static nserror | webp_clone (const struct content *old, struct content **new_c) |
Clone content. More... | |
CONTENT_FACTORY_REGISTER_TYPES (nswebp, webp_types, webp_content_handler) | |
Variables | |
static const content_handler | webp_content_handler |
static const char * | webp_types [] |
implementation of content handling for image/webp
This implementation uses the google webp library. Image cache handling is performed by the generic NetSurf handler.
Definition in file webp.c.
CONTENT_FACTORY_REGISTER_TYPES | ( | nswebp | , |
webp_types | , | ||
webp_content_handler | |||
) |
create a bitmap from webp content.
Definition at line 90 of file webp.c.
References netsurf_table::bitmap, bitmap(), bitmap_format_to_client(), BITMAP_LAYOUT_A8R8G8B8, BITMAP_LAYOUT_B8G8R8A8, BITMAP_LAYOUT_R8G8B8A8, BITMAP_NONE, BITMAP_OPAQUE, content__get_source_data(), gui_bitmap_table::create, gui_bitmap_table::destroy, fallthrough, gui_bitmap_table::get_buffer, gui_bitmap_table::get_rowstride, guit, bitmap_fmt::layout, gui_bitmap_table::modified, bitmap_fmt::pma, and bitmap::rowstride.
Referenced by webp_convert().
Clone content.
Definition at line 214 of file webp.c.
References content__clone(), content_destroy(), CONTENT_STATUS_DONE, CONTENT_STATUS_READY, NSERROR_CLONE_FAILED, NSERROR_NOMEM, NSERROR_OK, content::status, and webp_convert().
|
static |
Convert the webp source data content.
This ensures there is valid webp source data in the content object and then adds it to the image cache ready to be converted on demand.
c | The webp content object |
Definition at line 183 of file webp.c.
References content__get_source_data(), content_set_done(), content_set_ready(), content::height, height, image_cache_add(), NSLOG, content::size, webp_cache_convert(), content::width, and width.
Referenced by webp_clone().
|
static |
Content create entry point.
create a content object for the webp
Definition at line 53 of file webp.c.
References content__init(), content::fallback_charset, content::handler, llcache, NSERROR_NOMEM, NSERROR_OK, and content::quirks.
|
static |