NetSurf
|
Internal core bitmap interface. More...
Go to the source code of this file.
Data Structures | |
struct | bitmap_colour_layout |
Pixel format: colour component order. More... | |
Functions | |
static colour | bitmap_pixel_to_colour (const uint8_t *pixel) |
Convert a bitmap pixel to a NetSurf colour (0xAARRGGBB). More... | |
static enum bitmap_layout | bitmap_sanitise_bitmap_layout (enum bitmap_layout layout) |
Sanitise bitmap pixel component layout. More... | |
void | bitmap_format_convert (void *bitmap, const bitmap_fmt_t *from, const bitmap_fmt_t *to) |
Convert bitmap from one format to another. More... | |
static void | bitmap_format_to_client (void *bitmap, const bitmap_fmt_t *current_fmt) |
Convert a bitmap to the client bitmap format. More... | |
static void | bitmap_format_from_client (void *bitmap, const bitmap_fmt_t *target_fmt) |
Convert a bitmap to the client bitmap format. More... | |
Variables | |
bitmap_fmt_t | bitmap_fmt |
The client bitmap format. More... | |
struct bitmap_colour_layout | bitmap_layout |
The client bitmap colour channel layout. More... | |
Internal core bitmap interface.
Definition in file bitmap.h.
void bitmap_format_convert | ( | void * | bitmap, |
const bitmap_fmt_t * | from, | ||
const bitmap_fmt_t * | to | ||
) |
Convert bitmap from one format to another.
Note that both formats should be sanitised.
[in] | bitmap | The bitmap to convert. |
[in] | from | The current bitmap format specifier. |
[in] | to | The bitmap format to convert to. |
Definition at line 278 of file bitmap.c.
References netsurf_table::bitmap, bitmap__format_convert(), bitmap__format_convert_from_pma(), bitmap__format_convert_to_pma(), bitmap__get_colour_layout(), buffer, from, gui_bitmap_table::get_buffer, gui_bitmap_table::get_height, gui_bitmap_table::get_opaque, gui_bitmap_table::get_rowstride, gui_bitmap_table::get_width, guit, height, bitmap_fmt::layout, NSLOG, bitmap_fmt::pma, to, and width.
Referenced by bitmap_format_from_client(), and bitmap_format_to_client().
|
inlinestatic |
Convert a bitmap to the client bitmap format.
[in] | bitmap | The bitmap to convert. |
[in] | target_fmt | The target bitmap format specifier. |
Definition at line 135 of file bitmap.h.
References bitmap_format_convert(), bitmap_sanitise_bitmap_layout(), bitmap_fmt::layout, bitmap_fmt::pma, and to.
|
inlinestatic |
Convert a bitmap to the client bitmap format.
[in] | bitmap | The bitmap to convert. |
[in] | current_fmt | The current bitmap format specifier. |
Definition at line 117 of file bitmap.h.
References bitmap_format_convert(), bitmap_sanitise_bitmap_layout(), from, bitmap_fmt::layout, and bitmap_fmt::pma.
Referenced by jpegxl_cache_convert(), nsbmp_redraw(), nsico__decode(), nspng_convert(), nssprite_convert(), png_cache_convert(), rsvg_cache_convert(), rsvg_convert(), and webp_cache_convert().
|
inlinestatic |
Convert a bitmap pixel to a NetSurf colour (0xAARRGGBB).
The bitmap must be in the client format.
[in] | Pointer | to a pixel in the bitmap's pixel data. |
Definition at line 53 of file bitmap.h.
Referenced by image_bitmap_plot().
|
inlinestatic |
Sanitise bitmap pixel component layout.
Map endian-dependant layouts to byte-wise layout for the host.
[in] | layout | Layout to convert. |
Definition at line 69 of file bitmap.h.
References BITMAP_LAYOUT_A8B8G8R8, BITMAP_LAYOUT_A8R8G8B8, BITMAP_LAYOUT_ABGR8888, BITMAP_LAYOUT_ARGB8888, BITMAP_LAYOUT_B8G8R8A8, BITMAP_LAYOUT_BGRA8888, BITMAP_LAYOUT_R8G8B8A8, and BITMAP_LAYOUT_RGBA8888.
Referenced by bitmap_format_from_client(), bitmap_format_to_client(), and bitmap_set_format().
|
extern |
|
extern |