NetSurf
|
#include <sys/types.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include "netsurf/inttypes.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "netsurf/bitmap.h"
#include "netsurf/mouse.h"
#include "atari/bitmap.h"
#include "atari/plot/plot.h"
Go to the source code of this file.
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... | |
static void * | atari_bitmap_create_ex (int w, int h, short bpp, int rowstride, enum gui_bitmap_flags flags, void *pixdata) |
Create a bitmap. More... | |
void * | atari_bitmap_create (int w, int h, enum gui_bitmap_flags flags) |
Create a bitmap. More... | |
static void | bitmap_modified (void *bitmap) |
The bitmap image has changed, so flush any persistant cache. More... | |
void * | atari_bitmap_realloc (int w, int h, short bpp, int rowstride, unsigned int state, void *bmp) |
static unsigned char * | bitmap_get_buffer (void *bitmap) |
Return a pointer to the pixel data in a bitmap. More... | |
size_t | atari_bitmap_buffer_size (void *bitmap) |
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... | |
static void | bitmap_set_opaque (void *bitmap, bool opaque) |
Sets whether a bitmap should be plotted opaque. More... | |
bool | atari_bitmap_get_opaque (void *bitmap) |
Gets whether a bitmap should be plotted opaque. 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_resize (struct bitmap *img, HermesHandle hermes_h, HermesFormat *fmt, int nw, int nh) |
static nserror | bitmap_render (struct bitmap *bitmap, struct hlcache_handle *content) |
Variables | |
static struct gui_bitmap_table | bitmap_table |
struct gui_bitmap_table * | atari_bitmap_table = &bitmap_table |
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().
|
static |
Create a bitmap.
w | width of image in pixels |
h | height of image in pixels |
bpp | number of BYTES per pixel |
rowstride | linewidth in bytes |
state | a flag word indicating the initial state |
pixdata | NULL or an memory address to use as the bitmap pixdata |
Definition at line 80 of file bitmap.c.
References bitmap(), BITMAP_OPAQUE, bitmap::bpp, bitmap::height, NSLOG, bitmap::opaque, bitmap::pixdata, bitmap::resized, bitmap::rowstride, and bitmap::width.
Referenced by atari_bitmap_create(), and atari_bitmap_resize().
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().
|
static |
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 194 of file bitmap.c.
References bitmap(), NSLOG, and bitmap::pixdata.
|
static |
The bitmap image has changed, so flush any persistant cache.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 131 of file bitmap.c.
References atari_bitmap_destroy(), bitmap(), bitmap::converted, bitmap::native, bitmap::pixdata, and bitmap::resized.
Referenced by atari_bitmap_realloc().
|
static |
Definition at line 373 of file bitmap.c.
References NSERROR_NOT_IMPLEMENTED.
|
static |
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 257 of file bitmap.c.
References bitmap(), NSLOG, and bitmap::opaque.
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().
struct gui_bitmap_table* atari_bitmap_table = &bitmap_table |
|
static |