pike.git / src / modules / Image / blit.c

version» Context lines:

pike.git/src/modules/Image/blit.c:1: - /* $Id: blit.c,v 1.26 1998/01/13 22:59:21 hubbe Exp $ */ + /* $Id: blit.c,v 1.27 1998/01/16 22:09:07 grubba Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.26 1998/01/13 22:59:21 hubbe Exp $ + **! $Id: blit.c,v 1.27 1998/01/16 22:09:07 grubba Exp $   **! class image   */      #include <math.h>   #include <ctype.h>      #include "stralloc.h"   #include "global.h"   #include "pike_macros.h"   #include "object.h"
pike.git/src/modules/Image/blit.c:84:    INT32 args_start,INT32 args,char *name)   {    INT32 i;    if (args-args_start<3) return;    for (i=0; i<3; i++)    if (sp[-args+i+args_start].type!=T_INT)    error("Illegal r,g,b argument to %s\n",name);    img->rgb.r=(unsigned char)sp[-args+args_start].u.integer;    img->rgb.g=(unsigned char)sp[1-args+args_start].u.integer;    img->rgb.b=(unsigned char)sp[2-args+args_start].u.integer; -  if (args-args_start>=4) +  if (args-args_start>=4) {    if (sp[3-args+args_start].type!=T_INT)    error("Illegal alpha argument to %s\n",name);    else    img->alpha=sp[3-args+args_start].u.integer; -  else +  } else    img->alpha=0;   }      /*** end internals ***/         void img_clear(rgb_group *dest,rgb_group rgb,INT32 size)   {    if(!size) return;    THREADS_ALLOW();
pike.git/src/modules/Image/blit.c:387:    rgb_group *source = img->img;    struct image *this = THIS;    int xs = this->xsize, ix, mx=img->xsize, my=img->ysize, x;    int ys = this->ysize, iy, y;       THREADS_ALLOW();    for (iy=0; iy<my; iy++)    for (ix=0; ix<mx; ix++)    {    x = ix + x1; y = iy + y1; -  if(x>=0 && y>=0 && x<xs && y<ys) +  if(x>=0 && y>=0 && x<xs && y<ys) {    if(this->alpha)    set_rgb_group_alpha(this->img[x+y*xs],*(source),this->alpha);    else    this->img[x+y*xs]=*(source); -  +  }    source++;    }    THREADS_DISALLOW();    }    pop_n_elems(args);    THISOBJ->refs++;    push_object(THISOBJ);   }      /*