28 #include <sys/types.h> 55 NSLOG(netsurf, INFO,
"width %d, height %d, flags %u", width, height,
58 pbmi = calloc(1,
sizeof(BITMAPV5HEADER));
63 pbmi->bV5Size =
sizeof(BITMAPV5HEADER);
64 pbmi->bV5Width =
width;
67 pbmi->bV5BitCount = 32;
68 pbmi->bV5Compression = BI_BITFIELDS;
70 pbmi->bV5RedMask = 0xff;
71 pbmi->bV5GreenMask = 0xff00;
72 pbmi->bV5BlueMask = 0xff0000;
73 pbmi->bV5AlphaMask = 0xff000000;
75 windib = CreateDIBSection(NULL, (BITMAPINFO *)pbmi, DIB_RGB_COLORS, (
void **)&pixdata, NULL, 0);
82 bitmap = calloc(1 ,
sizeof(
struct bitmap));
100 NSLOG(netsurf, INFO,
"bitmap %p", bitmap);
117 struct bitmap *bm =
bitmap;
118 if (bitmap == NULL) {
119 NSLOG(netsurf, INFO,
"NULL bitmap!");
135 struct bitmap *bm =
bitmap;
137 if (bitmap == NULL) {
138 NSLOG(netsurf, INFO,
"NULL bitmap!");
142 return (bm->
width) * 4;
153 struct bitmap *bm =
bitmap;
155 if (bitmap == NULL) {
156 NSLOG(netsurf, INFO,
"NULL bitmap!");
182 struct bitmap *bm =
bitmap;
184 if (bitmap == NULL) {
185 NSLOG(netsurf, INFO,
"NULL bitmap!");
189 NSLOG(netsurf, INFO,
"setting bitmap %p to %s", bm,
190 opaque ?
"opaque" :
"transparent");
204 struct bitmap *bm =
bitmap;
206 if (bitmap == NULL) {
207 NSLOG(netsurf, INFO,
"NULL bitmap!");
214 if (bm->
pixdata[(tst << 2) + 3] != 0xff) {
215 NSLOG(netsurf, INFO,
"bitmap %p has transparency", bm);
219 NSLOG(netsurf, INFO,
"bitmap %p is opaque", bm);
231 struct bitmap *bm =
bitmap;
233 if (bitmap == NULL) {
234 NSLOG(netsurf, INFO,
"NULL bitmap!");
243 struct bitmap *bm =
bitmap;
245 if (bitmap == NULL) {
246 NSLOG(netsurf, INFO,
"NULL bitmap!");
255 struct bitmap *bm =
bitmap;
257 if (bitmap == NULL) {
258 NSLOG(netsurf, INFO,
"NULL bitmap!");
269 uint32_t *retpixdata, *inpixdata;
274 retpixdata = malloc(width * height * 4);
275 if (retpixdata == NULL) {
280 inpixdata = (uint32_t *)prescale->
pixdata;
281 ret->
pixdata = (uint8_t *)retpixdata;
284 for (i = 0; i <
height; i++) {
287 for (ii = 0; ii <
width; ii++) {
288 retpixdata[v + ii] = inpixdata[vv + (int)
302 HDC hdc, bufferdc, minidc;
303 struct bitmap *fsbitmap;
306 .background_images =
true,
311 height = ((width * bitmap->
height) + (bitmap->
width / 2)) /
314 NSLOG(netsurf, INFO,
"bitmap %p for content %p width %d, height %d",
315 bitmap, content, width, height);
318 bufferdc = CreateCompatibleDC(NULL);
319 if ((bufferdc == NULL)) {
323 minidc = CreateCompatibleDC(NULL);
324 if ((minidc == NULL)) {
332 SelectObject(bufferdc, fsbitmap->
windib);
341 SelectObject(minidc, bitmap->
windib);
345 StretchBlt(minidc, 0, 0, bitmap->
width, bitmap->
height, bufferdc, 0, 0, width, height, SRCCOPY);
Target independent plotting interface.
static bool bitmap_get_opaque(void *bitmap)
Gets whether a bitmap should be plotted opaque.
int bitmap_get_height(void *bitmap)
get height of a bitmap.
Interface to utility string handling.
Public content interface.
struct bitmap * bitmap_scale(struct bitmap *prescale, int width, int height)
const struct plotter_table win_plotters
win32 API plot operation table
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.
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
bool interactive
Redraw to show interactive features.
void win32_bitmap_destroy(void *bitmap)
Free a bitmap.
nserror
Enumeration of error codes.
int height
height of bitmap
static void bitmap_modified(void *bitmap)
The bitmap image has changed, so flush any persistant cache.
static void bitmap_set_opaque(void *bitmap, bool opaque)
Sets whether a bitmap should be plotted opaque.
Content which corresponds to a single URL.
static unsigned char * bitmap_get_buffer(void *bitmap)
Return a pointer to the pixel data in a bitmap.
static size_t bitmap_get_rowstride(void *bitmap)
Find the width of a pixel row in bytes.
#define NSLOG(catname, level, logmsg, args...)
RISC OS wimp toolkit bitmap.
static bool bitmap_test_opaque(void *bitmap)
Tests whether a bitmap has an opaque alpha channel.
gui_bitmap_flags
Bitmap creation flags.
memory should be wiped to 0
bool opaque
Whether the bitmap is opaque.
Netsurf additional integer type formatting macros.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
Generic bitmap handling interface.
int bitmap_get_width(void *bitmap)
get width of a bitmap.
struct gui_bitmap_table * win32_bitmap_table
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.
void *(* create)(int width, int height, enum gui_bitmap_flags flags)
Create a new bitmap.
static struct gui_bitmap_table bitmap_table
static void * win32_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
Create a bitmap.