|
NetSurf
|
#include <stdbool.h>#include <exec/types.h>#include <proto/graphics.h>#include <intuition/classusr.h>#include <libraries/Picasso96.h>#include "netsurf/bitmap.h"Go to the source code of this file.
Macros | |
| #define | AMI_BITMAP_FORMAT RGBFB_A8R8G8B8 |
| #define | AMI_BITMAP_SCALE_ICON 0xFF |
Functions | |
| struct BitMap * | ami_bitmap_get_native (struct bitmap *bitmap, int width, int height, bool palette_mapped, struct BitMap *friendbm, colour bg) |
| PLANEPTR | ami_bitmap_get_mask (struct bitmap *bitmap, int width, int height, struct BitMap *n_bm) |
| Object * | ami_datatype_object_from_bitmap (struct bitmap *bitmap) |
| struct bitmap * | ami_bitmap_from_datatype (char *filename) |
| void | ami_bitmap_set_url (struct bitmap *bm, struct nsurl *url) |
| Set bitmap URL. More... | |
| void | ami_bitmap_set_title (struct bitmap *bm, const char *title) |
| Set bitmap title. More... | |
| void | ami_bitmap_set_icondata (struct bitmap *bm, ULONG *icondata) |
| Set an icondata pointer. More... | |
| void | ami_bitmap_free_icondata (struct bitmap *bm) |
| Free an icondata pointer. More... | |
| bool | ami_bitmap_is_nativebm (struct bitmap *bm, struct BitMap *nbm) |
| Test if a BitMap is owned by a bitmap. More... | |
| void | ami_bitmap_fini (void) |
| Cleanup bitmap allocations. More... | |
| void * | amiga_bitmap_create (int width, int height, enum gui_bitmap_flags flags) |
| Create a bitmap. More... | |
| unsigned char * | amiga_bitmap_get_buffer (void *bitmap) |
| Return a pointer to the pixel data in a bitmap. More... | |
| size_t | amiga_bitmap_get_rowstride (void *bitmap) |
| Find the width of a pixel row in bytes. More... | |
| int | bitmap_get_width (void *bitmap) |
| Return the width of a bitmap. More... | |
| int | bitmap_get_height (void *bitmap) |
| Return the height of a bitmap. More... | |
| void | amiga_bitmap_destroy (void *bitmap) |
| Free a bitmap. More... | |
| bool | amiga_bitmap_save (void *bitmap, const char *path, unsigned flags) |
| Save a bitmap in the platform's native format. More... | |
| void | amiga_bitmap_modified (void *bitmap) |
| The bitmap image has changed, so flush any persistant cache. More... | |
| void | amiga_bitmap_set_opaque (void *bitmap, bool opaque) |
| Sets whether a bitmap should be plotted opaque. More... | |
| bool | amiga_bitmap_get_opaque (void *bitmap) |
| Gets whether a bitmap should be plotted opaque. More... | |
Variables | |
| struct gui_bitmap_table * | amiga_bitmap_table |
| void ami_bitmap_fini | ( | void | ) |
Cleanup bitmap allocations.
Definition at line 748 of file bitmap.c.
References ami_memory_itempool_delete, and pool_bitmap.
Referenced by main().
| void ami_bitmap_free_icondata | ( | struct bitmap * | bm | ) |
Free an icondata pointer.
| bm | a bitmap, as returned by bitmap_create() |
This function probably shouldn't be here!
Definition at line 807 of file bitmap.c.
References bitmap::icondata.
Referenced by amiga_icon_free().
| struct bitmap * ami_bitmap_from_datatype | ( | char * | filename | ) |
Definition at line 407 of file bitmap.c.
References amiga_bitmap_create(), amiga_bitmap_get_buffer(), amiga_bitmap_get_rowstride(), amiga_bitmap_set_opaque(), bitmap_test_opaque(), bitmap::dto, IDoMethod, and PDTA_PromoteMask.
Referenced by ami_theme_throbber_setup().
| PLANEPTR ami_bitmap_get_mask | ( | struct bitmap * | bitmap, |
| int | width, | ||
| int | height, | ||
| struct BitMap * | n_bm | ||
| ) |
Definition at line 696 of file bitmap.c.
References amiga_bitmap_get_buffer(), amiga_bitmap_get_opaque(), bitmap::height, height, bitmap::native_mask, nsoption_int, SetMem, bitmap::width, and width.
Referenced by ami_bitmap(), ami_bitmap_tile(), and gui_window_set_icon().
| struct BitMap * ami_bitmap_get_native | ( | struct bitmap * | bitmap, |
| int | width, | ||
| int | height, | ||
| bool | palette_mapped, | ||
| struct BitMap * | friendbm, | ||
| colour | bg | ||
| ) |
Definition at line 736 of file bitmap.c.
References ami_bitmap_get_palettemapped(), ami_bitmap_get_truecolour(), height, palette_mapped, and width.
Referenced by ami_bitmap(), ami_bitmap_tile(), ami_theme_throbber_setup(), amiga_icon_from_bitmap(), amiga_icon_superimpose_favicon_internal(), gui_search_web_provider_update(), and gui_window_set_icon().
| bool ami_bitmap_is_nativebm | ( | struct bitmap * | bm, |
| struct BitMap * | nbm | ||
| ) |
Test if a BitMap is owned by a bitmap.
| bm | a bitmap, as returned by bitmap_create() |
| nbm | a BitMap, as created by AllocBitMap() |
Definition at line 813 of file bitmap.c.
References bitmap::nativebm.
Referenced by ami_bitmap(), and ami_bitmap_tile().
| void ami_bitmap_set_icondata | ( | struct bitmap * | bm, |
| ULONG * | icondata | ||
| ) |
Set an icondata pointer.
| bm | a bitmap, as returned by bitmap_create() |
| icondata | a pointer to memory |
This function probably shouldn't be here!
Definition at line 802 of file bitmap.c.
References bitmap::icondata.
Referenced by amiga_icon_from_bitmap().
| void ami_bitmap_set_title | ( | struct bitmap * | bm, |
| const char * | title | ||
| ) |
Set bitmap title.
| bm | a bitmap, as returned by bitmap_create() |
| title | a pointer to a title string |
This is copied by the bitmap object. The title can only ever be set once for a bitmap.
Definition at line 796 of file bitmap.c.
References bitmap::title.
Referenced by ami_file_save(), and HOOKF().
Set bitmap URL.
| bm | a bitmap, as returned by bitmap_create() |
| url | the url for the bitmap |
A reference will be kept by the bitmap object. The URL can only ever be set once for a bitmap.
Definition at line 790 of file bitmap.c.
References nsurl_ref(), and bitmap::url.
Referenced by ami_file_save(), and HOOKF().
| Object * ami_datatype_object_from_bitmap | ( | struct bitmap * | bitmap | ) |
Definition at line 369 of file bitmap.c.
References amiga_bitmap_get_buffer(), amiga_bitmap_get_opaque(), amiga_bitmap_get_rowstride(), bitmap_get_height(), bitmap_get_width(), bitmap::dto, IDoMethod, messages_get(), nsurl_access(), bitmap::title, and bitmap::url.
Referenced by ami_easy_clipboard_bitmap(), and amiga_bitmap_save().
| void * amiga_bitmap_create | ( | int | width, |
| int | height, | ||
| enum gui_bitmap_flags | flags | ||
| ) |
Create a bitmap.
| width | width of image in pixels |
| height | width of image in pixels |
| flags | flags for bitmap creation |
Definition at line 112 of file bitmap.c.
References AllocSysObjectTags, ami_memory_clear_alloc(), ami_memory_itempool_alloc, ami_memory_itempool_create, AMI_NSBM_NONE, amiga_bitmap_get_buffer(), bitmap(), BITMAP_OPAQUE, bitmap::drawhandle, bitmap::height, height, bitmap::icondata, bitmap::iextmem, bitmap::native, bitmap::native_mask, bitmap::nativebm, bitmap::nativebmheight, bitmap::nativebmwidth, nsoption_bool, bitmap::opaque, bitmap::pixdata, pool_bitmap, bitmap::size, bitmap::title, bitmap::url, bitmap::width, and width.
Referenced by ami_bitmap_from_datatype().
| void amiga_bitmap_destroy | ( | void * | bitmap | ) |
Free a bitmap.
| bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 214 of file bitmap.c.
References ami_memory_clear_free, ami_memory_itempool_free, ami_rtg_freebitmap(), ami_schedule(), amiga_bitmap_unmap_buffer(), bitmap(), bitmap::drawhandle, FreeSysObject(), bitmap::height, bitmap::iextmem, bitmap::native_mask, bitmap::nativebm, nsoption_bool, nsurl_unref(), bitmap::pixdata, pool_bitmap, bitmap::title, bitmap::url, and bitmap::width.
Referenced by ami_theme_throbber_free().
| unsigned char * amiga_bitmap_get_buffer | ( | void * | bitmap | ) |
Return a pointer to the pixel data in a bitmap.
| bitmap | 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 175 of file bitmap.c.
References ami_schedule(), amiga_bitmap_unmap_buffer(), bitmap(), bitmap::iextmem, NSLOG, nsoption_bool, bitmap::pixdata, and bitmap::size.
Referenced by ami_bitmap_from_datatype(), ami_bitmap_get_generic(), ami_bitmap_get_guigfx(), ami_bitmap_get_mask(), ami_datatype_object_from_bitmap(), and amiga_bitmap_create().
| bool amiga_bitmap_get_opaque | ( | void * | bitmap | ) |
Gets whether a bitmap should be plotted opaque.
| bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 309 of file bitmap.c.
References bitmap(), and bitmap::opaque.
Referenced by ami_bitmap(), ami_bitmap_get_mask(), ami_bitmap_tile(), ami_datatype_object_from_bitmap(), and gui_window_set_icon().
| size_t amiga_bitmap_get_rowstride | ( | void * | bitmap | ) |
Find the width of a pixel row in bytes.
| bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 198 of file bitmap.c.
References bitmap(), and bitmap::width.
Referenced by ami_bitmap_from_datatype(), and ami_datatype_object_from_bitmap().
| void amiga_bitmap_modified | ( | void * | bitmap | ) |
The bitmap image has changed, so flush any persistant cache.
| bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 282 of file bitmap.c.
References AMI_NSBM_NONE, ami_rtg_freebitmap(), ami_schedule(), amiga_bitmap_unmap_buffer(), bitmap(), bitmap::height, bitmap::native, bitmap::native_mask, bitmap::nativebm, and bitmap::width.
Referenced by ami_bitmap_get_generic(), ami_bitmap_get_palettemapped(), and ami_bitmap_get_truecolour().
| bool amiga_bitmap_save | ( | void * | bitmap, |
| const char * | path, | ||
| unsigned | flags | ||
| ) |
Save a bitmap in the platform's native format.
| bitmap | a bitmap, as returned by bitmap_create() |
| path | pathname for file |
| flags | flags controlling how the bitmap is saved. |
Definition at line 257 of file bitmap.c.
References AMI_BITMAP_SCALE_ICON, ami_datatype_object_from_bitmap(), bitmap::dto, IDoMethod, path(), and SaveDTObjectA.
Referenced by ami_file_save(), and ami_gui_cache_favicon().
| void amiga_bitmap_set_opaque | ( | void * | bitmap, |
| bool | opaque | ||
| ) |
Sets whether a bitmap should be plotted opaque.
| bitmap | a bitmap, as returned by bitmap_create() |
| opaque | whether the bitmap should be plotted opaque |
Definition at line 300 of file bitmap.c.
References bitmap(), and bitmap::opaque.
Referenced by ami_bitmap_from_datatype(), and bitmap_render().
| int bitmap_get_height | ( | void * | bitmap | ) |
Return the height of a bitmap.
| bitmap | a bitmap, as returned by bitmap_create() |
Return the height of a bitmap.
Definition at line 336 of file bitmap.c.
References bitmap(), and bitmap::height.
Referenced by ami_bitmap_tile(), ami_datatype_object_from_bitmap(), ami_theme_throbber_get_height(), ami_theme_throbber_setup(), and riscos_bitmap_convert_8bpp().
| int bitmap_get_width | ( | void * | bitmap | ) |
Return the width of a bitmap.
| bitmap | a bitmap, as returned by bitmap_create() |
Return the width of a bitmap.
Definition at line 319 of file bitmap.c.
References bitmap(), and bitmap::width.
Referenced by ami_bitmap_tile(), ami_datatype_object_from_bitmap(), ami_theme_throbber_get_width(), ami_theme_throbber_setup(), and riscos_bitmap_convert_8bpp().
|
extern |