41int init_mfdb(
int bpp,
int w,
int h, uint32_t flags, MFDB * out )
45 int size =
MFDB_SIZE( bpp, dststride, h );
48 out->fd_addr = malloc( size );
49 if( out->fd_addr == NULL ){
53 memset( out->fd_addr, 0, size );
57 out->fd_nplanes = (short)bpp;
58 out->fd_r1 = out->fd_r2 = out->fd_r3 = 0;
60 memset( out, 0,
sizeof(MFDB) );
62 out->fd_w = dststride;
64 out->fd_wdwidth = dststride >> 4;
85 "width %d (rowstride: %d, bpp: %d), height %d, flags %u", w,
112 NSLOG(netsurf, INFO,
"Out of memory!");
140 free( bm->
native.fd_addr );
142 bm->
native.fd_addr = NULL;
160 bool doalloc = (state &
BITMAP_GROW) ? (newsize > oldsize) : (newsize != oldsize);
161 if( newsize > oldsize )
162 assert( doalloc ==
true );
199 NSLOG(netsurf, INFO,
"NULL bitmap!");
223 NSLOG(netsurf, INFO,
"NULL bitmap!");
236 NSLOG(netsurf, INFO,
"NULL bitmap!");
244 free( bm->
native.fd_addr );
262 NSLOG(netsurf, INFO,
"NULL bitmap!");
266 NSLOG(netsurf, INFO,
"setting bitmap %p to %s", bm,
267 opaque ?
"opaque" :
"transparent");
278 NSLOG(netsurf, INFO,
"NULL bitmap!");
292 NSLOG(netsurf, INFO,
"NULL bitmap!");
306 NSLOG(netsurf, INFO,
"NULL bitmap!");
314 HermesFormat *fmt,
int nw,
int nh)
332 if (img->
opaque ==
true) {
337 printf(
"W: %d, H: %d, bpp: %d\n", nw, nh,
bpp);
343 err = Hermes_ConverterRequest( hermes_h,
351 err = Hermes_ConverterCopy( hermes_h,
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
bool atari_bitmap_resize(struct bitmap *img, HermesHandle hermes_h, HermesFormat *fmt, int nw, int nh)
static void * atari_bitmap_create_ex(int w, int h, short bpp, int rowstride, enum gui_bitmap_flags flags, void *pixdata)
Create a bitmap.
static struct gui_bitmap_table bitmap_table
static void bitmap_modified(void *bitmap)
The bitmap image has changed, so flush any persistant cache.
size_t atari_bitmap_buffer_size(void *bitmap)
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
size_t atari_bitmap_get_rowstride(void *bitmap)
Find the width of a pixel row in bytes.
bool atari_bitmap_get_opaque(void *bitmap)
Gets whether a bitmap should be plotted opaque.
static unsigned char * bitmap_get_buffer(void *bitmap)
Return a pointer to the pixel data in a bitmap.
void atari_bitmap_destroy(void *bitmap)
Free a bitmap.
static void bitmap_set_opaque(void *bitmap, bool opaque)
Sets whether a bitmap should be plotted opaque.
void * atari_bitmap_create(int w, int h, enum gui_bitmap_flags flags)
Create a bitmap.
struct gui_bitmap_table * atari_bitmap_table
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.
int atari_bitmap_get_height(void *bitmap)
Get bitmap height.
int atari_bitmap_get_width(void *bitmap)
Get bitmap width.
void * atari_bitmap_realloc(int w, int h, short bpp, int rowstride, unsigned int state, void *bmp)
Atari bitmap handling implementation.
#define MFDB_SIZE(bpp, stride, h)
Calculate size of an mfdb,.
#define MFDB_FLAG_ZEROMEM
#define MFDB_FLAG_NOALLOC
#define NS_BMP_DEFAULT_BPP
#define MFDB_STRIDE(w)
Calculates MFDB compatible rowstride (in number of bits)
Generic bitmap handling interface.
gui_bitmap_flags
Bitmap creation flags.
@ BITMAP_CLEAR
memory should be wiped to 0
@ BITMAP_OPAQUE
image is opaque
Core mouse and pointer states.
Netsurf additional integer type formatting macros.
#define NSLOG(catname, level, logmsg, args...)
Interface to utility string handling.
RISC OS wimp toolkit bitmap.
int height
height of bitmap
bool opaque
Whether the bitmap is opaque.
Content which corresponds to a single URL.
void *(* create)(int width, int height, enum gui_bitmap_flags flags)
Create a new bitmap.
Option reading and saving 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.