NetSurf
Data Structures | Macros | Functions | Variables
bitmap.h File Reference
#include "netsurf/bitmap.h"
Include dependency graph for bitmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bitmap
 RISC OS wimp toolkit bitmap. More...
 

Macros

#define BITMAP_SAVE_FULL_ALPHA   (1 << 0)
 save with full alpha channel (if not opaque) More...
 

Functions

struct osspriteop_area * riscos_bitmap_convert_8bpp (struct bitmap *bitmap)
 Convert bitmap to 8bpp sprite. More...
 
nserror riscos_bitmap_render (struct bitmap *bitmap, struct hlcache_handle *content)
 Render content into bitmap. More...
 
void riscos_bitmap_overlay_sprite (struct bitmap *bitmap, const struct osspriteop_header *s)
 Overlay a sprite onto the given bitmap. More...
 
void * riscos_bitmap_create (int width, int height, enum gui_bitmap_flags flags)
 Create a bitmap. More...
 
void riscos_bitmap_destroy (void *vbitmap)
 Free a bitmap. More...
 
unsigned char * riscos_bitmap_get_buffer (void *vbitmap)
 Return a pointer to the pixel data in a bitmap. More...
 
bool riscos_bitmap_get_opaque (void *vbitmap)
 Gets whether a bitmap should be plotted opaque. More...
 
bool riscos_bitmap_save (void *vbitmap, const char *path, unsigned flags)
 Save a bitmap in the platform's native format. More...
 

Variables

struct gui_bitmap_tableriscos_bitmap_table
 bitmap operations table More...
 

Macro Definition Documentation

◆ BITMAP_SAVE_FULL_ALPHA

#define BITMAP_SAVE_FULL_ALPHA   (1 << 0)

save with full alpha channel (if not opaque)

Definition at line 33 of file bitmap.h.

Function Documentation

◆ riscos_bitmap_convert_8bpp()

struct osspriteop_area * riscos_bitmap_convert_8bpp ( struct bitmap bitmap)

Convert bitmap to 8bpp sprite.

Parameters
bitmapthe bitmap to convert.
Returns
The converted sprite.

Convert bitmap to 8bpp sprite.

Parameters
bitmapthe bitmap to convert
Returns
a sprite area containing an 8bpp sprite

Definition at line 633 of file bitmap.c.

References bitmap_get_height(), bitmap_get_rowstride(), bitmap_get_width(), riscos_bitmap_get_buffer(), save_area, bitmap::sprite_area, thumbnail_32bpp_available, thumbnail_create_8bpp(), thumbnail_restore_output(), thumbnail_switch_output(), tinct_ERROR_DIFFUSE, and Tinct_Plot.

Referenced by ro_gui_save_create_thumbnail(), and ro_gui_window_iconise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ riscos_bitmap_create()

void * riscos_bitmap_create ( int  width,
int  height,
enum gui_bitmap_flags  flags 
)

Create a bitmap.

Parameters
widthwidth of image in pixels
heightheight of image in pixels
flagsflags for bitmap creation.
Returns
an opaque struct bitmap, or NULL on memory exhaustion

Definition at line 125 of file bitmap.c.

References bitmap(), BITMAP_CLEAR, BITMAP_OPAQUE, bitmap::clear, bitmap::height, height, bitmap::opaque, bitmap::width, and width.

Referenced by ro_gui_save_create_thumbnail(), and ro_gui_window_iconise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ riscos_bitmap_destroy()

void riscos_bitmap_destroy ( void *  vbitmap)

Free a bitmap.

Parameters
vbitmapa bitmap, as returned by bitmap_create()

Definition at line 202 of file bitmap.c.

References bitmap::sprite_area.

Referenced by ro_gui_save_create_thumbnail(), and ro_gui_window_iconise().

Here is the caller graph for this function:

◆ riscos_bitmap_get_buffer()

unsigned char * riscos_bitmap_get_buffer ( void *  vbitmap)

Return a pointer to the pixel data in a bitmap.

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 riscos_bitmap_get_rowstride().

Parameters
vbitmapA bitmap as returned by riscos_bitmap_create()
Returns
pointer to the pixel buffer

Definition at line 145 of file bitmap.c.

References bitmap_initialise(), and bitmap::sprite_area.

Referenced by riscos_bitmap_convert_8bpp(), riscos_bitmap_overlay_sprite(), riscos_bitmap_render(), riscos_bitmap_save(), and ro_plot_bitmap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ riscos_bitmap_get_opaque()

bool riscos_bitmap_get_opaque ( void *  vbitmap)

Gets whether a bitmap should be plotted opaque.

Parameters
vbitmapA bitmap, as returned by riscos_bitmap_create()

Definition at line 193 of file bitmap.c.

References bitmap::opaque.

Referenced by riscos_bitmap_save(), ro_plot_bitmap(), and thumbnail_create_8bpp().

Here is the caller graph for this function:

◆ riscos_bitmap_overlay_sprite()

void riscos_bitmap_overlay_sprite ( struct bitmap bitmap,
const struct osspriteop_header *  s 
)

Overlay a sprite onto the given bitmap.

Parameters
bitmapbitmap object
s8bpp sprite to be overlayed onto bitmap

◆ riscos_bitmap_render()

nserror riscos_bitmap_render ( struct bitmap bitmap,
struct hlcache_handle content 
)

Render content into bitmap.

Parameters
bitmapthe bitmap to draw to
contentcontent structure to render
Returns
true on success and bitmap updated else false

Definition at line 724 of file bitmap.c.

References bitmap_modified(), colourtrans_SET_BG_GCOL, content_scaled_redraw(), bitmap::height, redraw_context::interactive, NSERROR_OK, NSLOG, riscos_bitmap_get_buffer(), ro_plot_origin_x, ro_plot_origin_y, ro_plotters, save_area, bitmap::sprite_area, thumbnail_32bpp_available, thumbnail_create_8bpp(), thumbnail_restore_output(), thumbnail_switch_output(), thumbnail_test(), Tinct_ConvertSprite, and bitmap::width.

Referenced by ro_gui_save_create_thumbnail(), and ro_gui_window_iconise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ riscos_bitmap_save()

bool riscos_bitmap_save ( void *  vbitmap,
const char *  path,
unsigned  flags 
)

Save a bitmap in the platform's native format.

Parameters
vbitmapa bitmap, as returned by bitmap_create()
pathpathname for file
flagsmodify the behaviour of the save
Returns
true on success, false on error and error reported

Definition at line 218 of file bitmap.c.

References BITMAP_SAVE_FULL_ALPHA, height, messages_get(), NSLOG, path(), riscos_bitmap_get_buffer(), riscos_bitmap_get_opaque(), ro_warn_user(), SAVE_CHUNK_SIZE, bitmap::sprite_area, and width.

Referenced by ro_gui_save_object_native().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ riscos_bitmap_table

struct gui_bitmap_table* riscos_bitmap_table
extern

bitmap operations table

Definition at line 818 of file bitmap.c.

Referenced by main().