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

version» Context lines:

pike.git/src/modules/Image/blit.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: blit.c,v 1.54 2002/10/21 17:06:13 marcus Exp $ + || $Id: blit.c,v 1.55 2003/03/31 14:42:21 grubba Exp $   */      #include "global.h"      /*   **! module Image   **! class Image   */      #include <math.h>
pike.git/src/modules/Image/blit.c:153:    INT32 x,mod;    rgb_group *foo,*end,rgb;    struct image *this;       this=THIS;    rgb=this->rgb;    mod=this->xsize-(x2-x1)-1;    foo=this->img+x1+y1*this->xsize;    end=this->img+x2+y2*this->xsize+1;    -  THREADS_ALLOW(); -  do { +     if(!this->alpha)    {    if(!mod)    img_clear(foo,rgb,end-foo);    else { -  +  THREADS_ALLOW(); +  do {    int length = x2-x1+1, xs=this->xsize, y=y2-y1+1;    rgb_group *from = foo;    if(!length)    break; /* Break to the while(0). */    for(x=0; x<length; x++) *(foo+x) = rgb;    while(--y) MEMCPY((foo+=xs), from, length*sizeof(rgb_group));    } -  +  } while(0); +  THREADS_DISALLOW();    }    else    { -  +  THREADS_ALLOW(); +  do {    for (; foo<=end; foo+=mod) for (x=x1; x<=x2; x++,foo++)    set_rgb_group_alpha(*foo,rgb,this->alpha); -  } +     } while(0);    THREADS_DISALLOW();    } -  + }         void img_blit(rgb_group *dest,rgb_group *src,INT32 width,    INT32 lines,INT32 moddest,INT32 modsrc)   {    if(width <= 0 || lines <= 0)    return;   CHRONO("image_blit begin");       THREADS_ALLOW();