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

version» Context lines:

pike.git/src/modules/Image/blit.c:1: - /* $Id: blit.c,v 1.13 1997/09/10 20:16:36 grubba Exp $ */ + /* $Id: blit.c,v 1.14 1997/09/18 23:32:00 grubba Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.13 1997/09/10 20:16:36 grubba Exp $<br> + **! $Id: blit.c,v 1.14 1997/09/18 23:32:00 grubba Exp $<br>   **! 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:586:       pop_n_elems(args);    THISOBJ->refs++;    push_object(THISOBJ);   }      void img_box(INT32 x1,INT32 y1,INT32 x2,INT32 y2)   {    if (x1>x2) x1^=x2,x2^=x1,x1^=x2;    if (y1>y2) y1^=y2,y2^=y1,y1^=y2; +  if (x2 >= THIS->xsize) x2 = THIS->xsize-1; +  if (y2 >= THIS->ysize) y2 = THIS->ysize-1;    if (x2<0||y2<0||x1>=THIS->xsize||y1>=THIS->ysize) return; -  +  if (x1<0) x1 = 0; +  if (y1<0) y1 = 0;    img_box_nocheck(max(x1,0),max(y1,0),min(x2,THIS->xsize-1),min(y2,THIS->ysize-1));   }         /*   **! method object add_layers(array(int|object)) layer0,...)   **! method object add_layers(int x1,int y1,int x2,int y2,array(int|object)) layer0,...)   **! Using the called object as base, adds layers using masks,   **! opaque channel values and special methods.   **!