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

version» Context lines:

pike.git/src/modules/Image/matrix.c:379:    (int)(THIS->ysize*sp[1-args].u.float_number));    else if (args>=2 &&    TYPEOF(sp[-args]) == T_INT &&    TYPEOF(sp[1-args]) == T_INT)    img_scale(newimg,THIS,    sp[-args].u.integer,    sp[1-args].u.integer);    else    {    free_object(o); -  bad_arg_error("scale",args,0,"",sp-args, -  "Bad arguments to scale.\n"); +  GENERIC_ARGS_ERROR();    }    pop_n_elems(args);    push_object(o);   }      /*   **! method object rotate_ccw()   **! rotates an image counter-clockwise, 90 degrees.   **!   **! <table><tr valign=center>
pike.git/src/modules/Image/matrix.c:877:    double diff=0;    struct object *o;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("skewx",1);    else if (TYPEOF(sp[-args]) == T_FLOAT)    diff = THIS->ysize*sp[-args].u.float_number;    else if (TYPEOF(sp[-args])== T_INT)    diff = (double)sp[-args].u.integer;    else -  bad_arg_error("skewx",args,0,"",sp-args, -  "Bad arguments to skewx.\n"); +  SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       CHECK_INIT();       o=clone_object(image_program,0);       if (!getrgb((struct image*)(o->storage),1,args,"skewx"))    ((struct image*)(o->storage))->rgb=THIS->rgb;       img_skewx(THIS,(struct image*)(o->storage),diff,0);   
pike.git/src/modules/Image/matrix.c:941:    double diff=0;    struct object *o;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("skewy",1);    else if (TYPEOF(sp[-args]) == T_FLOAT)    diff = THIS->xsize*sp[-args].u.float_number;    else if (TYPEOF(sp[-args]) == T_INT)    diff = (double)sp[-args].u.integer;    else -  bad_arg_error("skewy",args,0,"",sp-args, -  "Bad arguments to skewy.\n"); +  SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       CHECK_INIT();       o=clone_object(image_program,0);       if (!getrgb((struct image*)(o->storage),1,args,"skewy"))    ((struct image*)(o->storage))->rgb=THIS->rgb;       img_skewy(THIS,(struct image*)(o->storage),diff,0);   
pike.git/src/modules/Image/matrix.c:969:    double diff=0;    struct object *o;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("skewx_expand",1);    else if (TYPEOF(sp[-args]) == T_FLOAT)    diff = THIS->ysize*sp[-args].u.float_number;    else if (TYPEOF(sp[-args]) == T_INT)    diff = (double)sp[-args].u.integer;    else -  bad_arg_error("skewx_expand",args,0,"",sp-args, -  "Bad arguments to skewx_expand.\n"); +  SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       CHECK_INIT();       o=clone_object(image_program,0);       if (!getrgb((struct image*)(o->storage),1,args,"skewx_expand"))    ((struct image*)(o->storage))->rgb=THIS->rgb;       img_skewx(THIS,(struct image*)(o->storage),diff,1);   
pike.git/src/modules/Image/matrix.c:997:    double diff=0;    struct object *o;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("skewy_expand",1);    else if (TYPEOF(sp[-args]) == T_FLOAT)    diff = THIS->xsize*sp[-args].u.float_number;    else if (TYPEOF(sp[-args]) == T_INT)    diff = (double)sp[-args].u.integer;    else -  bad_arg_error("skewx_expand",args,0,"",sp-args, -  "Bad arguments to skewy_expand.\n"); +  SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       CHECK_INIT();       o=clone_object(image_program,0);       if (!getrgb((struct image*)(o->storage),1,args,"skewy_expand"))    ((struct image*)(o->storage))->rgb=THIS->rgb;       img_skewy(THIS,(struct image*)(o->storage),diff,1);   
pike.git/src/modules/Image/matrix.c:1028:    struct object *o;    struct image *dest,d0,dest2;       if (args<1)    SIMPLE_WRONG_NUM_ARGS_ERROR("rotate",1);    else if (TYPEOF(sp[-args]) == T_FLOAT)    angle = sp[-args].u.float_number;    else if (TYPEOF(sp[-args]) == T_INT)    angle = (double)sp[-args].u.integer;    else -  bad_arg_error("rotate",args,0,"",sp-args, -  "Bad arguments to rotate.\n"); +  SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       CHECK_INIT();       dest2.img=d0.img=NULL;       if (angle<-135) angle-=360*(int)((angle-225)/360);    else if (angle>225) angle-=360*(int)((angle+135)/360);    if (angle<-45)    {    img_ccw(THIS,&dest2);
pike.git/src/modules/Image/matrix.c:1130:    int y,x;    struct object *o;    struct image *img;    rgb_group *s,*d;       if (args<2)    Pike_error("illegal number of arguments to image->translate()\n");       if (TYPEOF(sp[-args]) == T_FLOAT) xt=sp[-args].u.float_number;    else if (TYPEOF(sp[-args]) == T_INT) xt=sp[-args].u.integer; -  else bad_arg_error("translate",args,1,"",sp+1-1-args, -  "Bad argument 1 to translate.\n"); +  else SIMPLE_ARG_TYPE_ERROR(NULL, 1, "int|float");       if (TYPEOF(sp[1-args]) == T_FLOAT) yt=sp[1-args].u.float_number;    else if (TYPEOF(sp[1-args]) == T_INT) yt=sp[1-args].u.integer; -  else bad_arg_error("translate",args,2,"",sp+2-1-args, -  "Bad argument 2 to translate.\n"); +  else SIMPLE_ARG_TYPE_ERROR(NULL, 2, "int|float");       getrgb(THIS,2,args,"translate");       xt-=floor(xt);    yt-=floor(yt);       o=clone_object(image_program,0);    img=(struct image*)o->storage;       img->xsize=THIS->xsize+(xt!=0);