NetSurf
|
BeOS implementation of generic bitmaps. More...
#include <assert.h>
#include <sys/param.h>
#include <string.h>
#include <Bitmap.h>
#include <BitmapStream.h>
#include <File.h>
#include <GraphicsDefs.h>
#include <TranslatorFormats.h>
#include <TranslatorRoster.h>
#include <View.h>
#include <stdlib.h>
#include "utils/log.h"
#include "netsurf/plotters.h"
#include "netsurf/content_type.h"
#include "netsurf/browser_window.h"
#include "netsurf/bitmap.h"
#include "netsurf/content.h"
#include "beos/bitmap.h"
#include "beos/gui.h"
#include "beos/scaffolding.h"
#include "beos/plotters.h"
Go to the source code of this file.
Data Structures | |
struct | bitmap |
RISC OS wimp toolkit bitmap. More... | |
Macros | |
#define | __STDBOOL_H__ 1 |
#define | MIN_PRETILE_WIDTH 256 |
#define | MIN_PRETILE_HEIGHT 256 |
#define | FREE_TILE(XY) if (bitmap->pretile_##XY) delete (bitmap->pretile_##XY); bitmap->pretile_##XY = NULL |
Functions | |
static void | nsbeos_rgba_to_bgra (void *src, void *dst, int width, int height, size_t rowstride) |
Convert to BeOS RGBA32_LITTLE (strictly BGRA) from NetSurf's favoured ABGR format. More... | |
static void * | bitmap_create (int width, int height, enum gui_bitmap_flags flags) |
Create a bitmap. More... | |
static void | bitmap_set_opaque (void *vbitmap, bool opaque) |
Sets whether a bitmap should be plotted opaque. More... | |
static bool | bitmap_get_opaque (void *vbitmap) |
Gets whether a bitmap should be plotted opaque. More... | |
static unsigned char * | bitmap_get_buffer (void *vbitmap) |
Return a pointer to the pixel data in a bitmap. More... | |
static size_t | bitmap_get_rowstride (void *vbitmap) |
Find the width of a pixel row in bytes. More... | |
static void | nsbeos_bitmap_free_pretiles (struct bitmap *bitmap) |
Free pretiles of a bitmap. More... | |
static void | bitmap_destroy (void *vbitmap) |
Free a bitmap. More... | |
void | bitmap_modified (void *vbitmap) |
The bitmap image has changed, so flush any persistant cache. More... | |
static int | bitmap_get_width (void *vbitmap) |
static int | bitmap_get_height (void *vbitmap) |
static BBitmap * | nsbeos_bitmap_generate_pretile (BBitmap *primary, int repeat_x, int repeat_y) |
BBitmap * | nsbeos_bitmap_get_primary (struct bitmap *bitmap) |
The primary image associated with this bitmap object. More... | |
BBitmap * | nsbeos_bitmap_get_pretile_x (struct bitmap *bitmap) |
The X-pretiled image associated with this bitmap object. More... | |
BBitmap * | nsbeos_bitmap_get_pretile_y (struct bitmap *bitmap) |
The Y-pretiled image associated with this bitmap object. More... | |
BBitmap * | nsbeos_bitmap_get_pretile_xy (struct bitmap *bitmap) |
The XY-pretiled image associated with this bitmap object. More... | |
static nserror | bitmap_render (struct bitmap *bitmap, hlcache_handle *content) |
Create a thumbnail of a page. More... | |
Variables | |
static struct gui_bitmap_table | bitmap_table |
struct gui_bitmap_table * | beos_bitmap_table = &bitmap_table |
BeOS implementation of generic bitmaps.
This implements the interface given by image/bitmap.h using BBitmap.
Definition in file bitmap.cpp.
#define __STDBOOL_H__ 1 |
Definition at line 26 of file bitmap.cpp.
#define FREE_TILE | ( | XY | ) | if (bitmap->pretile_##XY) delete (bitmap->pretile_##XY); bitmap->pretile_##XY = NULL |
#define MIN_PRETILE_HEIGHT 256 |
Definition at line 64 of file bitmap.cpp.
#define MIN_PRETILE_WIDTH 256 |
Definition at line 63 of file bitmap.cpp.
|
static |
Create a bitmap.
width | width of image in pixels |
height | height of image in pixels |
bflags | flags for bitmap creation |
Definition at line 121 of file bitmap.cpp.
References BITMAP_CLEAR, BITMAP_OPAQUE, height, bitmap::opaque, bitmap::pretile_x, bitmap::pretile_xy, bitmap::pretile_y, bitmap::primary, bitmap::shadow, and width.
|
static |
Free a bitmap.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 223 of file bitmap.cpp.
References nsbeos_bitmap_free_pretiles(), bitmap::primary, and bitmap::shadow.
|
static |
Return a pointer to the pixel data in a bitmap.
vbitmap | 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 181 of file bitmap.cpp.
References bitmap::shadow.
|
static |
Definition at line 258 of file bitmap.cpp.
References bitmap::primary.
|
static |
Gets whether a bitmap should be plotted opaque.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 163 of file bitmap.cpp.
References bitmap::opaque.
|
static |
Find the width of a pixel row in bytes.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 195 of file bitmap.cpp.
References bitmap::primary.
|
static |
Definition at line 251 of file bitmap.cpp.
References bitmap::primary.
void bitmap_modified | ( | void * | vbitmap | ) |
The bitmap image has changed, so flush any persistant cache.
vbitmap | a bitmap, as returned by bitmap_create() |
Definition at line 239 of file bitmap.cpp.
References nsbeos_bitmap_free_pretiles(), nsbeos_rgba_to_bgra(), bitmap::primary, and bitmap::shadow.
Referenced by bitmap_render().
|
static |
Create a thumbnail of a page.
bitmap | the bitmap to draw to |
content | content structure to thumbnail |
Definition at line 379 of file bitmap.cpp.
References redraw_context::background_images, bitmap_modified(), content_get_width(), content_scaled_redraw(), height, redraw_context::interactive, MIN, nsbeos_bitmap_get_primary(), nsbeos_current_gc(), nsbeos_current_gc_set(), nsbeos_plotters, NSERROR_NOMEM, NSERROR_OK, redraw_context::plot, view, and width.
|
static |
Sets whether a bitmap should be plotted opaque.
vbitmap | a bitmap, as returned by bitmap_create() |
opaque | whether the bitmap should be plotted opaque |
Definition at line 150 of file bitmap.cpp.
References bitmap::opaque.
|
static |
Free pretiles of a bitmap.
bitmap | The bitmap to free the pretiles of. |
Definition at line 208 of file bitmap.cpp.
References FREE_TILE.
Referenced by bitmap_destroy(), and bitmap_modified().
|
static |
Definition at line 266 of file bitmap.cpp.
References height, bitmap::primary, result, and width.
Referenced by nsbeos_bitmap_get_pretile_x(), nsbeos_bitmap_get_pretile_xy(), and nsbeos_bitmap_get_pretile_y().
BBitmap * nsbeos_bitmap_get_pretile_x | ( | struct bitmap * | bitmap | ) |
The X-pretiled image associated with this bitmap object.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 320 of file bitmap.cpp.
References MIN_PRETILE_WIDTH, nsbeos_bitmap_generate_pretile(), NSLOG, bitmap::pretile_x, bitmap::primary, and width.
Referenced by nsbeos_plot_bitmap().
BBitmap * nsbeos_bitmap_get_pretile_xy | ( | struct bitmap * | bitmap | ) |
The XY-pretiled image associated with this bitmap object.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 357 of file bitmap.cpp.
References height, MIN_PRETILE_HEIGHT, MIN_PRETILE_WIDTH, nsbeos_bitmap_generate_pretile(), NSLOG, bitmap::pretile_xy, bitmap::primary, and width.
Referenced by nsbeos_plot_bitmap().
BBitmap * nsbeos_bitmap_get_pretile_y | ( | struct bitmap * | bitmap | ) |
The Y-pretiled image associated with this bitmap object.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 339 of file bitmap.cpp.
References height, MIN_PRETILE_HEIGHT, nsbeos_bitmap_generate_pretile(), NSLOG, bitmap::pretile_y, and bitmap::primary.
Referenced by nsbeos_plot_bitmap().
BBitmap * nsbeos_bitmap_get_primary | ( | struct bitmap * | bitmap | ) |
The primary image associated with this bitmap object.
bitmap | a bitmap, as returned by bitmap_create() |
Definition at line 308 of file bitmap.cpp.
References bitmap::primary.
Referenced by bitmap_render(), gui_window_set_icon(), and nsbeos_plot_bitmap().
|
inlinestatic |
Convert to BeOS RGBA32_LITTLE (strictly BGRA) from NetSurf's favoured ABGR format.
Copies the converted data elsewhere. Operation is rotate left 8 bits.
src | Source 32-bit pixels arranged in ABGR order. |
dst | Output data in BGRA order. |
width | Width of the bitmap |
height | Height of the bitmap |
rowstride | Number of bytes to skip after each row (this implementation requires this to be a multiple of 4.) |
Definition at line 82 of file bitmap.cpp.
References from, height, to, and width.
Referenced by bitmap_modified().
struct gui_bitmap_table* beos_bitmap_table = &bitmap_table |
Definition at line 499 of file bitmap.cpp.
Referenced by gui_init_replicant(), and main().
|
static |
Definition at line 486 of file bitmap.cpp.