25 #include <sys/types.h> 29 #include <libnsfb_plot.h> 54 bm = nsfb_new(NSFB_SURFACE_RAM);
60 nsfb_set_geometry(bm, width, height, NSFB_FMT_ABGR8888);
62 nsfb_set_geometry(bm, width, height, NSFB_FMT_XBGR8888);
65 if (nsfb_init(bm) == -1) {
86 unsigned char *bmpptr;
90 nsfb_get_buffer(bm, &bmpptr, NULL);
109 nsfb_get_buffer(bm, NULL, &bmpstride);
151 nsfb_set_geometry(bm, 0, 0, NSFB_FMT_XBGR8888);
153 nsfb_set_geometry(bm, 0, 0, NSFB_FMT_ABGR8888);
168 unsigned char *bmpptr;
174 nsfb_get_buffer(bm, &bmpptr, NULL);
176 nsfb_get_geometry(bm, &width, &height, NULL);
181 if (bmpptr[(tst << 2) + 3] != 0xff) {
182 NSLOG(netsurf, INFO,
"bitmap %p has transparency", bm);
186 NSLOG(netsurf, INFO,
"bitmap %p is opaque", bm);
199 enum nsfb_format_e format;
203 nsfb_get_geometry(bm, NULL, NULL, &format);
205 if (format == NSFB_FMT_ABGR8888)
218 nsfb_get_geometry(bm, &width, NULL, NULL);
230 nsfb_get_geometry(bm, NULL, &height, NULL);
246 nsfb_t *tbm = (nsfb_t *)bitmap;
255 .background_images =
true,
259 nsfb_get_geometry(tbm, &width, &height, NULL);
261 NSLOG(netsurf, INFO,
"width %d, height %d", width, height);
271 cheight = ((cwidth *
height) + (width / 2)) / width;
274 bm = nsfb_new(NSFB_SURFACE_RAM);
279 nsfb_set_geometry(bm, cwidth, cheight, NSFB_FMT_XBGR8888);
281 if (nsfb_init(bm) == -1) {
298 nsfb_plot_copy(bm, NULL, tbm, &loc);
struct gui_bitmap_table * framebuffer_bitmap_table
Target independent plotting interface.
static size_t bitmap_get_rowstride(void *bitmap)
Find the width of a pixel row in bytes.
int bitmap_get_height(void *bitmap)
get height of a bitmap.
static struct gui_bitmap_table bitmap_table
Public content interface.
static nserror bitmap(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags)
Plot a bitmap.
bool framebuffer_bitmap_get_opaque(void *bitmap)
Gets weather a bitmap should be plotted opaque.
bool interactive
Redraw to show interactive features.
const struct plotter_table fb_plotters
framebuffer plot operation table
nserror
Enumeration of error codes.
static void bitmap_modified(void *bitmap)
The bitmap image has changed, so flush any persistant cache.
Content which corresponds to a single URL.
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
Render content into a bitmap.
#define NSLOG(catname, level, logmsg, args...)
RISC OS wimp toolkit bitmap.
gui_bitmap_flags
Bitmap creation flags.
nsfb_t * framebuffer_set_surface(nsfb_t *new_nsfb)
Set framebuffer surface to render into.
Netsurf additional integer type formatting macros.
static unsigned char * bitmap_get_buffer(void *bitmap)
Return a pointer to the pixel data in a bitmap.
static void bitmap_set_opaque(void *bitmap, bool opaque)
Sets wether a bitmap should be plotted opaque.
static bool bitmap_test_opaque(void *bitmap)
Tests whether a bitmap has an opaque alpha channel.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
Interface to a number of general purpose functionality.
static void bitmap_destroy(void *bitmap)
Free a bitmap.
Generic bitmap handling interface.
int bitmap_get_width(void *bitmap)
get width of a bitmap.
bool content_scaled_redraw(struct hlcache_handle *h, int width, int height, const struct redraw_context *ctx)
Redraw a content with scale set for horizontal fit.
void *(* create)(int width, int height, enum gui_bitmap_flags flags)
Create a new bitmap.
static void * bitmap_create(int width, int height, enum gui_bitmap_flags flags)
Create a bitmap.