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

version» Context lines:

pike.git/src/modules/Image/blit.c:1: - /* $Id: blit.c,v 1.48 2000/08/23 18:57:27 grubba Exp $ */ + /* $Id: blit.c,v 1.49 2000/12/01 08:09:58 hubbe Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.48 2000/08/23 18:57:27 grubba Exp $ + **! $Id: blit.c,v 1.49 2000/12/01 08:09:58 hubbe Exp $   **! class Image   */      #include <math.h>   #include <ctype.h>      #include "stralloc.h"   #include "global.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "array.h" - #include "error.h" + #include "pike_error.h"   #include "threads.h"      #include "image.h"   #include "image_machine.h"      #ifdef ASSEMBLY_OK   #include "assembly.h"   #endif      /* This must be included last! */
pike.git/src/modules/Image/blit.c:94:    INT32 i;    if (args-args_start<1) return 0;       if (image_color_svalue(sp-args+args_start,&(img->rgb)))    return 1;       if (max<3 || args-args_start<3) return 0;       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); +  Pike_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 (max > 3 && args-args_start>=4) {    if (sp[3-args+args_start].type!=T_INT) { -  error("Illegal alpha argument to %s\n",name); +  Pike_error("Illegal alpha argument to %s\n",name);    }    img->alpha=sp[3-args+args_start].u.integer;    return 4;    }    img->alpha=0;    return 3;   }         /*** end internals ***/
pike.git/src/modules/Image/blit.c:454:   void image_paste_mask(INT32 args)   {    struct image *img = NULL, *mask = NULL;    INT32 x1,y1,x,y,x2,y2,smod,dmod,mmod;    rgb_group *s,*d,*m;    double q;      CHRONO("image_paste_mask init");       if (args<2) -  error("illegal number of arguments to image->paste_mask()\n"); +  Pike_error("illegal number of arguments to image->paste_mask()\n");    if (sp[-args].type!=T_OBJECT    || !(img=(struct image*)get_storage(sp[-args].u.object,image_program)))    bad_arg_error("image->paste_mask",sp-args,args,1,"",sp+1-1-args,    "Bad argument 1 to image->paste_mask()\n");    if (sp[1-args].type!=T_OBJECT    || !(mask=(struct image*)get_storage(sp[1-args].u.object,image_program)))    bad_arg_error("image->paste_mask",sp-args,args,2,"",sp+2-1-args,    "Bad argument 2 to image->paste_mask()\n");    if (!THIS->img) return;       if (!mask->img) return;    if (!img->img) return;       if (args>=4)    {    if (sp[2-args].type!=T_INT    || sp[3-args].type!=T_INT) -  error("illegal coordinate arguments to image->paste_mask()\n"); +  Pike_error("illegal coordinate arguments to image->paste_mask()\n");    x1=sp[2-args].u.integer;    y1=sp[3-args].u.integer;    }    else x1=y1=0;       x2=MINIMUM(THIS->xsize-x1,MINIMUM(img->xsize,mask->xsize));    y2=MINIMUM(THIS->ysize-y1,MINIMUM(img->ysize,mask->ysize));      CHRONO("image_paste_mask begin");   
pike.git/src/modules/Image/blit.c:574:    "Bad argument 1 to image->paste_alpha_color()\n");    if (!THIS->img) return;    if (!mask->img) return;       if (args==6 || args==4 || args==2 || args==3) /* color at arg 2.. */    arg=1+getrgb(THIS,1,args,3,"image->paste_alpha_color()\n");    if (args>arg+1)    {    if (sp[arg-args].type!=T_INT    || sp[1+arg-args].type!=T_INT) -  error("illegal coordinate arguments to image->paste_alpha_color()\n"); +  Pike_error("illegal coordinate arguments to image->paste_alpha_color()\n");    x1=sp[arg-args].u.integer;    y1=sp[1+arg-args].u.integer;    }    else x1=y1=0;       x2=MINIMUM(THIS->xsize-x1,mask->xsize);    y2=MINIMUM(THIS->ysize-y1,mask->ysize);      CHRONO("image_paste_alpha_color begin");