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

version» Context lines:

pike.git/src/modules/Image/blit.c:26:      #define sp Pike_sp      extern struct program *image_program;   #ifdef THIS   #undef THIS /* Needed for NT */   #endif   #define THIS ((struct image *)(Pike_fp->current_storage))   #define THISOBJ (Pike_fp->current_object)    - #define absdiff(a,b) ((a)<(b)?((b)-(a)):((a)-(b))) -  +    #if 0   #include <sys/resource.h>   #define CHRONO(X) chrono(X)      static void chrono(char *x)   {    struct rusage r;    static struct rusage rold;    getrusage(RUSAGE_SELF,&r);    fprintf(stderr,"%s: %ld.%06ld - %ld.%06ld\n",x,
pike.git/src/modules/Image/blit.c:54:    );       rold=r;   }   #else   #define CHRONO(X)   #endif      /***************** internals ***********************************/    - #define testrange(x) MAXIMUM(MINIMUM((x),255),0) -  - #define apply_alpha(x,y,alpha) \ -  ((unsigned char)((y*(255L-(alpha))+x*(alpha))/255L)) -  - #define set_rgb_group_alpha(dest,src,alpha) \ -  (((dest).r=apply_alpha((dest).r,(src).r,alpha)), \ -  ((dest).g=apply_alpha((dest).g,(src).g,alpha)), \ -  ((dest).b=apply_alpha((dest).b,(src).b,alpha))) -  - #define pixel(_img,x,y) ((_img)->img[(x)+(y)*(_img)->xsize]) -  - #define setpixel(x,y) \ -  (THIS->alpha? \ -  set_rgb_group_alpha(THIS->img[(x)+(y)*THIS->xsize],THIS->rgb,THIS->alpha): \ -  ((pixel(THIS,x,y)=THIS->rgb),0)) -  - #define setpixel_test(x,y) \ -  (((x)<0||(y)<0||(x)>=THIS->xsize||(y)>=THIS->ysize)? \ -  0:(setpixel(x,y),0)) -  +    static inline int getrgb(struct image *img,    INT32 args_start,INT32 args,INT32 max,char *name)   {    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;