NetSurf
|
GTK bitmap handling. More...
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <cairo.h>
#include <gtk/gtk.h>
#include "utils/utils.h"
#include "utils/errors.h"
#include "netsurf/content.h"
#include "netsurf/bitmap.h"
#include "netsurf/plotters.h"
#include "gtk/scaffolding.h"
#include "gtk/plotters.h"
#include "gtk/bitmap.h"
Go to the source code of this file.
Functions | |
static void * | bitmap_create (int width, int height, enum gui_bitmap_flags flags) |
Create a bitmap. More... | |
static void | bitmap_set_opaque (void *vbitmap, bool opaque) |
Sets whether a bitmap should be plotted opaque. More... | |
static bool | bitmap_get_opaque (void *vbitmap) |
Gets whether a bitmap should be plotted opaque. More... | |
static unsigned char * | bitmap_get_buffer (void *vbitmap) |
Return a pointer to the pixel data in a bitmap. More... | |
static size_t | bitmap_get_rowstride (void *vbitmap) |
Find the width of a pixel row in bytes. More... | |
static void | bitmap_destroy (void *vbitmap) |
Free a bitmap. More... | |
static void | bitmap_modified (void *vbitmap) |
The bitmap image has changed, so flush any persistant cache. More... | |
int | nsgtk_bitmap_get_width (void *vbitmap) |
int | nsgtk_bitmap_get_height (void *vbitmap) |
static nserror | bitmap_render (struct bitmap *bitmap, struct hlcache_handle *content) |
Render content into a bitmap. More... | |
Variables | |
static struct gui_bitmap_table | bitmap_table |
struct gui_bitmap_table * | nsgtk_bitmap_table = &bitmap_table |
GTK bitmap handling.
This implements the bitmap interface using cairo image surfaces
Definition in file bitmap.c.
|
static |
Create a bitmap.
width | width of image in pixels |
height | height of image in pixels |
flags | flags for bitmap creation |
Definition at line 52 of file bitmap.c.
References BITMAP_OPAQUE, height, bitmap::opaque, bitmap::surface, and width.
|
static |
Free a bitmap.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 148 of file bitmap.c.
References bitmap::scsurface, and bitmap::surface.
|
static |
Return a pointer to the pixel data in a bitmap.
vbitmap | a bitmap, as returned by bitmap_create() |
The pixel data is packed as BITMAP_FORMAT, possibly with padding at the end of rows. The width of a row in bytes is given by bitmap_get_rowstride().
Definition at line 114 of file bitmap.c.
References bitmap::surface.
|
static |
Gets whether a bitmap should be plotted opaque.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 97 of file bitmap.c.
References bitmap::opaque.
|
static |
Find the width of a pixel row in bytes.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 134 of file bitmap.c.
References bitmap::surface.
|
static |
The bitmap image has changed, so flush any persistant cache.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 168 of file bitmap.c.
References bitmap::surface.
|
static |
Render content into a bitmap.
bitmap | The bitmap to draw to |
content | The content to render |
Definition at line 203 of file bitmap.c.
References content_get_width(), content_scaled_redraw(), current_cr, redraw_context::interactive, max, min, NSERROR_OK, nsgtk_plotters, and bitmap::surface.
|
static |
Sets whether a bitmap should be plotted opaque.
vbitmap | a bitmap, as returned by bitmap_create() |
opaque | whether the bitmap should be plotted opaque |
Definition at line 84 of file bitmap.c.
References bitmap::opaque.
int nsgtk_bitmap_get_height | ( | void * | vbitmap | ) |
Definition at line 187 of file bitmap.c.
References bitmap::surface.
Referenced by nsgtk_print_plot_bitmap().
int nsgtk_bitmap_get_width | ( | void * | vbitmap | ) |
Definition at line 178 of file bitmap.c.
References bitmap::surface.
Referenced by nsgtk_print_plot_bitmap().
|
static |
struct gui_bitmap_table* nsgtk_bitmap_table = &bitmap_table |