23#ifndef _NETSURF_DESKTOP_BITMAP_H_
24#define _NETSURF_DESKTOP_BITMAP_H_
26#include <nsutils/endian.h>
72 bool le = endian_host_is_le();
static enum bitmap_layout bitmap_sanitise_bitmap_layout(enum bitmap_layout layout)
Sanitise bitmap pixel component layout.
void bitmap_format_convert(void *bitmap, const bitmap_fmt_t *from, const bitmap_fmt_t *to)
Convert bitmap from one format to another.
bitmap_fmt_t bitmap_fmt
The client bitmap format.
static void bitmap_format_from_client(void *bitmap, const bitmap_fmt_t *target_fmt)
Convert a bitmap to the client bitmap format.
static void bitmap_format_to_client(void *bitmap, const bitmap_fmt_t *current_fmt)
Convert a bitmap to the client bitmap format.
static colour bitmap_pixel_to_colour(const uint8_t *pixel)
Convert a bitmap pixel to a NetSurf colour (0xAARRGGBB).
Generic bitmap handling interface.
bitmap_layout
NetSurf bitmap pixel layout.
@ BITMAP_LAYOUT_ABGR8888
32-bit BGRA (0xAABBGGRR).
@ BITMAP_LAYOUT_BGRA8888
32-bit BGRA (0xBBGGRRAA).
@ BITMAP_LAYOUT_ARGB8888
32-bit ARGB (0xAARRGGBB).
@ BITMAP_LAYOUT_B8G8R8A8
Bite-wise BGRA: Byte order: 0xBB, 0xGG, 0xRR, 0xAA.
@ BITMAP_LAYOUT_R8G8B8A8
Bite-wise RGBA: Byte order: 0xRR, 0xGG, 0xBB, 0xAA.
@ BITMAP_LAYOUT_A8B8G8R8
Bite-wise ABGR: Byte order: 0xAA, 0xBB, 0xGG, 0xRR.
@ BITMAP_LAYOUT_A8R8G8B8
Bite-wise ARGB: Byte order: 0xAA, 0xRR, 0xGG, 0xBB.
@ BITMAP_LAYOUT_RGBA8888
32-bit RGBA (0xRRGGBBAA).
Pixel format: colour component order.
uint8_t g
Byte offset within pixel to green component.
uint8_t b
Byte offset within pixel to blue component.
uint8_t a
Byte offset within pixel to alpha component.
uint8_t r
Byte offset within pixel to red component.
bool pma
Premultiplied alpha.
enum bitmap_layout layout
Colour component layout.
RISC OS wimp toolkit bitmap.
uint32_t colour
Colour type: XBGR.
char from[32]
Encoding name to convert from.
char to[32]
Encoding name to convert to.