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

version» Context lines:

pike.git/src/modules/Image/blit.c:1: - /* $Id: blit.c,v 1.18 1997/11/11 01:58:37 grubba Exp $ */ + /* $Id: blit.c,v 1.19 1997/11/23 05:28:27 per Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.18 1997/11/11 01:58:37 grubba Exp $ + **! $Id: blit.c,v 1.19 1997/11/23 05:28:27 per 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:97:    img->alpha=sp[3-args+args_start].u.integer;    else    img->alpha=0;   }      /*** end internals ***/         void img_clear(rgb_group *dest,rgb_group rgb,INT32 size)   { +  int ok = 0;    THREADS_ALLOW(); -  while (size--) *(dest++)=rgb; +  if(sizeof(rgb.r) == 1) +  { +  if(rgb.r == rgb.b && rgb.b == rgb.g) +  (ok = 1),MEMSET(dest, rgb.r, size*sizeof(rgb_group)); +  } else { +  if(!rgb.r && !rgb.b && !rgb.g) +  (ok = 1),MEMSET(dest, 0, size*sizeof(rgb_group)); +  } +  if(!ok) +  { +  int increment = 1; +  rgb_group *from = dest; +  *(dest++)=rgb; +  for (; size > increment; size-=increment,dest+=increment,increment*=2) +  MEMCPY(dest,from,increment*sizeof(rgb_group)); +  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;    struct image *this;       this=THIS;