NetSurf
|
Atari bitmap handling implementation. More...
#include <gem.h>
#include <Hermes/Hermes.h>
Go to the source code of this file.
Data Structures | |
struct | bitmap |
RISC OS wimp toolkit bitmap. More... | |
Macros | |
#define | NS_BMP_DEFAULT_BPP 4 |
#define | MFDB_FLAG_STAND 0x01 |
#define | MFDB_FLAG_ZEROMEM 0x02 |
#define | MFDB_FLAG_NOALLOC 0x04 |
#define | BITMAP_SHRINK 0 |
#define | BITMAP_GROW 1024 /* Don't realloc when bitmap size shrinks */ |
#define | BITMAP_CLEAR 2048 /* Zero bitmap memory */ |
#define | MFDB_STRIDE(w) (((w & 15) != 0) ? (w | 15)+1 : w) |
Calculates MFDB compatible rowstride (in number of bits) More... | |
#define | MFDB_SIZE(bpp, stride, h) ( ((stride >> 3) * h) * bpp ) |
Calculate size of an mfdb,. More... | |
Functions | |
int | init_mfdb (int bpp, int w, int h, uint32_t flags, MFDB *out) |
setup an MFDB struct and allocate memory for it when it is needed. More... | |
void * | atari_bitmap_create (int w, int h, enum gui_bitmap_flags flags) |
Create a bitmap. More... | |
size_t | atari_bitmap_get_rowstride (void *bitmap) |
Find the width of a pixel row in bytes. More... | |
void | atari_bitmap_destroy (void *bitmap) |
Free a bitmap. More... | |
int | atari_bitmap_get_width (void *bitmap) |
Get bitmap width. More... | |
int | atari_bitmap_get_height (void *bitmap) |
Get bitmap height. More... | |
bool | atari_bitmap_get_opaque (void *bitmap) |
Gets whether a bitmap should be plotted opaque. More... | |
size_t | atari_bitmap_buffer_size (void *bitmap) |
bool | atari_bitmap_resize (struct bitmap *img, HermesHandle hermes_h, HermesFormat *fmt, int nw, int nh) |
void * | atari_bitmap_realloc (int w, int h, short bpp, int rowstride, unsigned int state, void *bmp) |
Variables | |
struct gui_bitmap_table * | atari_bitmap_table |
Atari bitmap handling implementation.
Definition in file bitmap.h.
#define BITMAP_GROW 1024 /* Don't realloc when bitmap size shrinks */ |
#define MFDB_SIZE | ( | bpp, | |
stride, | |||
h | |||
) | ( ((stride >> 3) * h) * bpp ) |
#define MFDB_STRIDE | ( | w | ) | (((w & 15) != 0) ? (w | 15)+1 : w) |
size_t atari_bitmap_buffer_size | ( | void * | bitmap | ) |
Definition at line 208 of file bitmap.c.
References bitmap(), bitmap::height, and bitmap::rowstride.
Referenced by snapshot_suspend().
void * atari_bitmap_create | ( | int | w, |
int | h, | ||
enum gui_bitmap_flags | flags | ||
) |
Create a bitmap.
w | width of image in pixels |
h | width of image in pixels |
state | a flag word indicating the initial state |
Definition at line 121 of file bitmap.c.
References atari_bitmap_create_ex(), and NS_BMP_DEFAULT_BPP.
Referenced by snapshot_create().
void atari_bitmap_destroy | ( | void * | bitmap | ) |
Free a bitmap.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 231 of file bitmap.c.
References atari_bitmap_destroy(), bitmap(), bitmap::converted, bitmap::native, NSLOG, bitmap::pixdata, and bitmap::resized.
Referenced by atari_bitmap_destroy(), atari_bitmap_resize(), bitmap_convert_tc(), bitmap_modified(), and snapshot_destroy().
int atari_bitmap_get_height | ( | void * | bitmap | ) |
Get bitmap height.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 301 of file bitmap.c.
References bitmap(), bitmap::height, and NSLOG.
Referenced by atari_bitmap_resize(), bitmap_convert_tc(), and plot_bitmap().
bool atari_bitmap_get_opaque | ( | void * | bitmap | ) |
Gets whether a bitmap should be plotted opaque.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 273 of file bitmap.c.
References bitmap(), NSLOG, and bitmap::opaque.
Referenced by bitmap_convert_tc().
size_t atari_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 218 of file bitmap.c.
References bitmap(), NSLOG, and bitmap::rowstride.
Referenced by ablend_bitmap(), ablend_pixel(), atari_bitmap_resize(), and snapshot_create().
int atari_bitmap_get_width | ( | void * | bitmap | ) |
Get bitmap width.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 287 of file bitmap.c.
References bitmap(), NSLOG, and bitmap::width.
Referenced by atari_bitmap_resize(), bitmap_convert_tc(), and plot_bitmap().
void * atari_bitmap_realloc | ( | int | w, |
int | h, | ||
short | bpp, | ||
int | rowstride, | ||
unsigned int | state, | ||
void * | bmp | ||
) |
Definition at line 149 of file bitmap.c.
References BITMAP_CLEAR, BITMAP_GROW, bitmap_modified(), bitmap::bpp, bitmap::height, bitmap::pixdata, bitmap::resized, bitmap::rowstride, and bitmap::width.
Referenced by snapshot_create(), and snapshot_suspend().
bool atari_bitmap_resize | ( | struct bitmap * | img, |
HermesHandle | hermes_h, | ||
HermesFormat * | fmt, | ||
int | nw, | ||
int | nh | ||
) |
Definition at line 313 of file bitmap.c.
References atari_bitmap_create_ex(), atari_bitmap_destroy(), atari_bitmap_get_height(), atari_bitmap_get_rowstride(), atari_bitmap_get_width(), BITMAP_OPAQUE, bitmap::bpp, bitmap::height, bitmap::opaque, bitmap::pixdata, bitmap::resized, and bitmap::width.
Referenced by plot_bitmap().
int init_mfdb | ( | int | bpp, |
int | w, | ||
int | h, | ||
uint32_t | flags, | ||
MFDB * | out | ||
) |
setup an MFDB struct and allocate memory for it when it is needed.
If bpp == 0, this function assumes that the MFDB shall point to the screen and will not allocate any memory (mfdb.fd_addr == 0).
Definition at line 41 of file bitmap.c.
References MFDB_FLAG_NOALLOC, MFDB_FLAG_STAND, MFDB_FLAG_ZEROMEM, MFDB_SIZE, and MFDB_STRIDE.
Referenced by plot_blit_mfdb(), snapshot_create_native_mfdb(), and window_place_caret().
|
extern |