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

version» Context lines:

pike.git/src/modules/Image/blit.c:1: - /* $Id: blit.c,v 1.22 1997/11/23 21:58:53 per Exp $ */ + /* $Id: blit.c,v 1.23 1997/11/24 15:43:10 mirar Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.22 1997/11/23 21:58:53 per Exp $ + **! $Id: blit.c,v 1.23 1997/11/24 15:43:10 mirar 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:108:    THREADS_ALLOW();    if(!rgb.r && !rgb.b && !rgb.g)    MEMSET(dest, 0, size*sizeof(rgb_group));    else if((sizeof(rgb.r) == 1) && (rgb.r == rgb.b && rgb.b == rgb.g))    MEMSET(dest, rgb.r, size*sizeof(rgb_group));    else if(size)    {    int increment = 1;    rgb_group *from = dest;    *(dest++)=rgb; -  size--; -  for (; size > increment; size-=increment,dest+=increment) +  size -= 1; +  while (size>increment)    {    MEMCPY(dest,from,increment*sizeof(rgb_group)); -  if(increment < 1024) increment *= 2; +  size-=increment,dest+=increment; +  if (increment<1024) increment *= 2;    }    if(size>0) MEMCPY(dest,from,size*sizeof(rgb_group));    }    THREADS_DISALLOW();   }      void img_box_nocheck(INT32 x1,INT32 y1,INT32 x2,INT32 y2)   {    INT32 x,mod;    rgb_group *foo,*end,rgb;
pike.git/src/modules/Image/blit.c:143:    {    if(!mod)    img_clear(foo,rgb,end-foo);    else {    int length = x2-x1+1, xs=this->xsize, y=y2-y1+1;    rgb_group *from = foo;    if(!length) return;    for(x=0; x<length; x++) *(foo+x) = rgb;    while(--y) MEMCPY((foo+=xs), from, length*sizeof(rgb_group));    } -  } else { +  } +  else +  {    for (; foo<=end; foo+=mod) for (x=x1; x<=x2; x++,foo++)    set_rgb_group_alpha(*foo,rgb,this->alpha);    }    THREADS_DISALLOW();   }         void img_blit(rgb_group *dest,rgb_group *src,INT32 width,    INT32 lines,INT32 moddest,INT32 modsrc)   {