Ok, reverting changes for the draw_pixel function. Now Imlib_image_draw_pixel

uses Tom's macro (__imlib_draw_set_point and *_clipped) so it's faster and it
handles clipping, too.
Btw Tom, I choosed not to change the name of the wrap function so that :
1) I don't have to change it in doc/index.html ;)
2) I think it's a little more in line with Imlib_image_draw_line ...

Lightman


SVN revision: 5305
This commit is contained in:
Franz Marini 2001-08-29 09:14:32 +00:00
parent b490abdb4e
commit 02944af5cb
2 changed files with 0 additions and 51 deletions

View File

@ -441,54 +441,6 @@ __imlib_TileImageVert(ImlibImage * im)
im->data = data;
}
ImlibUpdate *
__imlib_draw_pixel(ImlibImage *im, int x, int y, DATA8 r, DATA8 g, DATA8 b,
DATA8 a, ImlibOp op, char make_updates)
{
int tmp;
DATA32 *p;
/*clip to edges */
if ((x < 0) || (x >= im->w) || (y < 0) || (y >= im->h))
return NULL;
switch(op)
{
case OP_COPY:
p = &(im->data[im->w * y + x]);
BLEND(r, g, b, a, p);
if (!make_updates)
return NULL;
return __imlib_AddUpdate(NULL, x, y, 1, 1);
break;
case OP_ADD:
p = &(im->data[im->w * y + x]);
BLEND_ADD(r, g, b, a, p);
if (!make_updates)
return NULL;
return __imlib_AddUpdate(NULL, x, y, 1, 1);
break;
case OP_SUBTRACT:
p = &(im->data[im->w * y + x]);
BLEND_SUB(r, g, b, a, p);
if (!make_updates)
return NULL;
return __imlib_AddUpdate(NULL, x, y, 1, 1);
break;
case OP_RESHADE:
p = &(im->data[im->w * y + x]);
BLEND_RE(r, g, b, a, p);
if (!make_updates)
return NULL;
return __imlib_AddUpdate(NULL, x, y, 1, 1);
break;
default:
break;
}
return NULL;
}
ImlibUpdate *
__imlib_draw_line(ImlibImage * im, int x1, int y1, int x2, int y2, DATA8 r,
DATA8 g, DATA8 b, DATA8 a, ImlibOp op, char make_updates)

View File

@ -136,9 +136,6 @@ void __imlib_BlurImage(ImlibImage * im, int rad);
void __imlib_SharpenImage(ImlibImage * im, int rad);
void __imlib_TileImageHoriz(ImlibImage * im);
void __imlib_TileImageVert(ImlibImage * im);
ImlibUpdate *__imlib_draw_pixel(ImlibImage *im, int x, int y, DATA8 r,
DATA8 g, DATA8 b, DATA8 a, ImlibOp op,
char make_updates);
ImlibUpdate *__imlib_draw_line(ImlibImage * im, int x1, int y1, int x2,
int y2, DATA8 r, DATA8 g, DATA8 b, DATA8 a,
ImlibOp op, char make_updates);