[w3m-dev 03931] Re: clear image
* w3mimgdisplay.c (ClearImage): offset * w3mimg/fb/fb.c (fb_clear): memcpy by pixel_size From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2003-07-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03931] Re: clear image
|
||||||
|
* w3mimgdisplay.c (ClearImage): offset
|
||||||
|
* w3mimg/fb/fb.c (fb_clear): memcpy by pixel_size
|
||||||
|
|
||||||
2003-07-08 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
2003-07-08 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03929] clear image
|
* [w3m-dev 03929] clear image
|
||||||
@@ -7892,4 +7898,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.845 2003/07/07 15:48:16 ukai Exp $
|
$Id: ChangeLog,v 1.846 2003/07/08 17:29:56 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: fb.c,v 1.11 2003/07/07 15:49:39 ukai Exp $ */
|
/* $Id: fb.c,v 1.12 2003/07/08 17:29:56 ukai Exp $ */
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
fb.c 0.3 Copyright (C) 2002, hito
|
fb.c 0.3 Copyright (C) 2002, hito
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
@@ -368,8 +368,8 @@ fb_height(void)
|
|||||||
int
|
int
|
||||||
fb_clear(int x, int y, int w, int h, int r, int g, int b)
|
fb_clear(int x, int y, int w, int h, int r, int g, int b)
|
||||||
{
|
{
|
||||||
unsigned long bg;
|
unsigned long work;
|
||||||
int i, offset_fb;
|
int i, j, offset_fb;
|
||||||
|
|
||||||
if (is_open != TRUE || x > fb_width() || y > fb_height())
|
if (is_open != TRUE || x > fb_width() || y > fb_height())
|
||||||
return 1;
|
return 1;
|
||||||
@@ -379,11 +379,12 @@ fb_clear(int x, int y, int w, int h, int r, int g, int b)
|
|||||||
h = fb_height() - y;
|
h = fb_height() - y;
|
||||||
|
|
||||||
offset_fb = fscinfo.line_length * y + pixel_size * x;
|
offset_fb = fscinfo.line_length * y + pixel_size * x;
|
||||||
bg = ((r >> (CHAR_BIT - vscinfo.red.length)) << vscinfo.red.offset) +
|
work = ((r >> (CHAR_BIT - vscinfo.red.length)) << vscinfo.red.offset) +
|
||||||
((g >> (CHAR_BIT - vscinfo.green.length)) << vscinfo.green.offset) +
|
((g >> (CHAR_BIT - vscinfo.green.length)) << vscinfo.green.offset) +
|
||||||
((b >> (CHAR_BIT - vscinfo.blue.length)) << vscinfo.blue.offset);
|
((b >> (CHAR_BIT - vscinfo.blue.length)) << vscinfo.blue.offset);
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
memcpy(buf + offset_fb, bg, pixel_size * w);
|
for (j = 0; j < w; j++)
|
||||||
|
memcpy(buf + offset_fb + pixel_size * j, &work, pixel_size);
|
||||||
offset_fb += fscinfo.line_length;
|
offset_fb += fscinfo.line_length;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: w3mimgdisplay.c,v 1.15 2003/07/07 15:49:03 ukai Exp $ */
|
/* $Id: w3mimgdisplay.c,v 1.16 2003/07/08 17:29:56 ukai Exp $ */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -324,5 +324,5 @@ ClearImage(char *buf)
|
|||||||
for (; isdigit(*p); p++)
|
for (; isdigit(*p); p++)
|
||||||
h = 10 * h + (*p - '0');
|
h = 10 * h + (*p - '0');
|
||||||
|
|
||||||
w_op->clear(w_op, x, y, w, h);
|
w_op->clear(w_op, x + offset_x, y + offset_y, w, h);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user