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.57 2004/05/19 00:10:10 nilsson Exp $ + || $Id: blit.c,v 1.58 2005/08/14 02:25:06 nilsson Exp $   */      #include "global.h"      /*   **! module Image   **! class Image   */      #include <math.h>
pike.git/src/modules/Image/blit.c:208:    INT32 x2,INT32 y2)   {    rgb_group *new;    INT32 xp,yp,xs,ys,tmp;       if (dest->img) { free(dest->img); dest->img=NULL; }       if (x1>x2) tmp=x1, x1=x2, x2=tmp;    if (y1>y2) tmp=y1, y1=y2, y2=tmp;    -  new=xalloc( (x2-x1+1)*(y2-y1+1)*sizeof(rgb_group) + 1); +  new=xalloc( (x2-x1+1)*(y2-y1+1)*sizeof(rgb_group) );       if (x1==0 && y1==0 &&    img->xsize-1==x2 && img->ysize-1==y2)    {    *dest=*img;    THREADS_ALLOW();    MEMCPY(new,img->img,(x2-x1+1)*(y2-y1+1)*sizeof(rgb_group));    THREADS_DISALLOW();    dest->img=new;    return;
pike.git/src/modules/Image/blit.c:252:    dest->xsize,    img->xsize);       }    dest->img=new;   }      void img_clone(struct image *newimg,struct image *img)   {    if (newimg->img) free(newimg->img); -  newimg->img=xalloc(sizeof(rgb_group)*img->xsize*img->ysize +1); +  newimg->img=xalloc(sizeof(rgb_group)*img->xsize*img->ysize);    THREADS_ALLOW();    MEMCPY(newimg->img,img->img,sizeof(rgb_group)*img->xsize*img->ysize);    THREADS_DISALLOW();    newimg->xsize=img->xsize;    newimg->ysize=img->ysize;    newimg->rgb=img->rgb;   }      /*   **! method object paste(object image)