26#define __STDBOOL_H__ 1
31#include <BitmapStream.h>
33#include <GraphicsDefs.h>
34#include <TranslatorFormats.h>
35#include <TranslatorRoster.h>
63#define MIN_PRETILE_WIDTH 256
64#define MIN_PRETILE_HEIGHT 256
66#warning TODO: check rgba order
67#warning TODO: add correct locking (not strictly required)
88 struct abgr {
uint8 a, b, g, r; };
89 struct rgba {
uint8 r, g, b ,a; };
90 struct bgra {
uint8 b, g, r, a; };
91 struct rgba *
from = (
struct rgba *)src;
92 struct bgra *
to = (
struct bgra *)dst;
96 for (
int y = 0; y <
height; y++) {
97 for (
int x = 0; x <
width; x++) {
129 Bflags |= B_BITMAP_CLEAR_TO_WHITE;
133 bmp->
primary =
new BBitmap(frame, Bflags, B_RGBA32);
134 bmp->
shadow =
new BBitmap(frame, Bflags, B_RGBA32);
210#define FREE_TILE(XY) if (bitmap->pretile_##XY) delete (bitmap->pretile_##XY); bitmap->pretile_##XY = NULL
270 size_t primary_stride =
primary->BytesPerRow();
271 BRect frame(0, 0,
width * repeat_x - 1,
height * repeat_y - 1);
272 BBitmap *
result =
new BBitmap(frame, 0, B_RGBA32);
274 char *target_buffer = (
char *)
result->Bits();
277 assert((
size_t)(
result->BytesPerRow()) ==
278 (primary_stride * repeat_x));
280 if (repeat_x == 1 && repeat_y == 1) {
286 for (y = 0; y < repeat_y; ++y) {
287 char *primary_buffer = (
char *)
primary->Bits();
288 for (row = 0; row <
height; ++row) {
289 for (x = 0; x < repeat_x; ++x) {
290 memcpy(target_buffer,
291 primary_buffer, primary_stride);
292 target_buffer += primary_stride;
294 primary_buffer += primary_stride;
325 NSLOG(netsurf, INFO,
"Pretiling %p for X*%d",
bitmap, xmult);
344 NSLOG(netsurf, INFO,
"Pretiling %p for Y*%d",
bitmap, ymult);
364 NSLOG(netsurf, INFO,
"Pretiling %p for X*%d Y*%d",
bitmap,
402 width = thumbnail->Bounds().Width();
403 height = thumbnail->Bounds().Height();
409 BRect contentRect(0, 0, big_width - 1, big_height - 1);
410 big =
new BBitmap(contentRect, B_BITMAP_ACCEPTS_VIEWS, B_RGB32);
412 if (big->InitCheck() < B_OK) {
417 small =
new BBitmap(thumbnail->Bounds(),
418 B_BITMAP_ACCEPTS_VIEWS, B_RGB32);
420 if (small->InitCheck() < B_OK) {
430 view =
new BView(contentRect,
"thumbnailer",
431 B_FOLLOW_NONE, B_WILL_DRAW);
434 thumbView =
new BView(small->Bounds(),
"thumbnail",
435 B_FOLLOW_NONE, B_WILL_DRAW);
436 small->AddChild(thumbView);
447 view->UnlockLooper();
458 thumbView->LockLooper();
459 thumbView->DrawBitmap(big, big->Bounds(), small->Bounds());
461 thumbView->UnlockLooper();
464 thumbnail->LockBits();
467 memcpy(thumbnail->Bits(), small->Bits(), thumbnail->BitsLength());
469 thumbnail->UnlockBits();
475 small->RemoveChild(thumbView);
478 big->RemoveChild(
view);
static struct s_view view
static void bitmap_set_opaque(void *vbitmap, bool opaque)
Sets whether a bitmap should be plotted opaque.
static struct gui_bitmap_table bitmap_table
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.
static bool bitmap_get_opaque(void *vbitmap)
Gets whether a bitmap should be plotted opaque.
BBitmap * nsbeos_bitmap_get_pretile_xy(struct bitmap *bitmap)
The XY-pretiled image associated with this bitmap object.
#define MIN_PRETILE_HEIGHT
#define MIN_PRETILE_WIDTH
static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
Create a thumbnail of a page.
struct gui_bitmap_table * beos_bitmap_table
static unsigned char * bitmap_get_buffer(void *vbitmap)
Return a pointer to the pixel data in a bitmap.
static int bitmap_get_height(void *vbitmap)
static BBitmap * nsbeos_bitmap_generate_pretile(BBitmap *primary, int repeat_x, int repeat_y)
void bitmap_modified(void *vbitmap)
The bitmap image has changed, so flush any persistant cache.
static size_t bitmap_get_rowstride(void *vbitmap)
Find the width of a pixel row in bytes.
BBitmap * nsbeos_bitmap_get_primary(struct bitmap *bitmap)
The primary image associated with this bitmap object.
static void * bitmap_create(int width, int height, enum gui_bitmap_flags flags)
Create a bitmap.
static int bitmap_get_width(void *vbitmap)
static void bitmap_destroy(void *vbitmap)
Free a bitmap.
static void nsbeos_bitmap_free_pretiles(struct bitmap *bitmap)
Free pretiles of a bitmap.
BBitmap * nsbeos_bitmap_get_pretile_x(struct bitmap *bitmap)
The X-pretiled image associated with this bitmap object.
BBitmap * nsbeos_bitmap_get_pretile_y(struct bitmap *bitmap)
The Y-pretiled image associated with this bitmap object.
Browser window creation and manipulation interface.
Declaration of content enumerations.
nserror
Enumeration of error codes.
@ NSERROR_NOMEM
Memory exhaustion.
Target independent plotting (BeOS interface).
Generic bitmap handling interface.
gui_bitmap_flags
Bitmap creation flags.
@ BITMAP_CLEAR
memory should be wiped to 0
@ BITMAP_OPAQUE
image is opaque
Public content interface.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
bool content_scaled_redraw(struct hlcache_handle *h, int width, int height, const struct redraw_context *ctx)
Redraw a content with scale set for horizontal fit.
Target independent plotting interface.
#define NSLOG(catname, level, logmsg, args...)
const struct plotter_table nsbeos_plotters
beos plotter operation table
void nsbeos_current_gc_set(BView *view)
BView * nsbeos_current_gc(void)
Interface to utility string handling.
RISC OS wimp toolkit bitmap.
bool opaque
Whether the bitmap is opaque.
Content which corresponds to a single URL.
bool background_images
Render background images.
const struct plotter_table * plot
Current plot operation table.
bool interactive
Redraw to show interactive features.
char from[32]
Encoding name to convert from.
char to[32]
Encoding name to convert to.