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

version» Context lines:

pike.git/src/modules/Image/layers.c:1:   /*   **! module Image   **! note - **! $Id: layers.c,v 1.37 1999/08/13 05:58:00 per Exp $ + **! $Id: layers.c,v 1.38 1999/08/15 23:25:55 mirar Exp $   **! class Layer   **! see also: layers   **!      **!   **!   **! <add_appendix name="layers" title="Image.Layer modes">   **! <dl compact>   **! <dt><i>The variables in the expression:</i>   **! <dt>L<dd><i>The active layer</i>
pike.git/src/modules/Image/layers.c:208:   **! }   **!   **! </execute>   **! </add_appendix>   */      #include "global.h"      #include <math.h> /* floor */    - RCSID("$Id: layers.c,v 1.37 1999/08/13 05:58:00 per Exp $"); + RCSID("$Id: layers.c,v 1.38 1999/08/15 23:25:55 mirar Exp $");      #include "image_machine.h"      #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "array.h"
pike.git/src/modules/Image/layers.c:1276:    {    MEMCPY(d,l,sizeof(rgb_group)*len);    smear_color(da,white,len);    }    else    {    while (len--)    {    if (la->r==0 && la->g==0 && la->b==0)    { + #if 0    int n=0;    do    {    n++; la++;    }    while (len && len-- && la->r==0 && la->g==0 && la->b==0);    if (n>1)    {    MEMCPY(d,s,n*sizeof(rgb_group));    MEMCPY(da,sa,n*sizeof(rgb_group));    l+=n; s+=n; sa+=n; d+=n; da+=n;    }    else    *(d++)=*(s++),*(da++)=*(sa++),l++;    continue; -  + #else +  *d=*s; +  *da=*sa; + #endif    }    else if (la->r==COLORMAX && la->g==COLORMAX && la->b==COLORMAX)    {    *d=*l;    *da=*la;    }    else if (l->r==COLORMAX && l->g==COLORMAX && l->b==COLORMAX)    {    ALPHA_ADD(s,&white,d,sa,la,da,r);    ALPHA_ADD(s,&white,d,sa,la,da,g);
pike.git/src/modules/Image/layers.c:2181:      static INLINE void img_lay_stroke(struct layer *ly,    rgb_group *l,    rgb_group *la,    rgb_group *s,    rgb_group *sa,    rgb_group *d,    rgb_group *da,    int len)   { -  if (ly->row_func==lm_spec_burn_alpha) +  if (ly->row_func==(lm_row_func*)lm_spec_burn_alpha)    {    lm_spec_burn_alpha(ly,l,la,s,sa,d,da,len);    return;    }       if (l)    {    (ly->row_func)(s,l,d,sa,la,da,len,ly->alpha_value);    return;    }
pike.git/src/modules/Image/layers.c:2628:    l->tiled=THIS->tiled;    l->row_func=THIS->row_func;    l->optimize_alpha=THIS->optimize_alpha;    l->really_optimize_alpha=THIS->really_optimize_alpha;    return l;   }      /*   **! module Image   **! class Layer +  +  + **! method object clone() + **! Creates a copy of the called object. + **! returns the copy + */ +  + static void image_layer_clone(INT32 args) + { +  pop_n_elems(args); +  clone_this_layer(); + } +  + /*   **! method object crop(int xoff,int yoff,int xsize,int ysize)   **! Crops this layer at this offset and size.   **! Offset is not relative the layer offset, so this   **! can be used to crop a number of layers simuntaneously.   **!   **! The <ref>fill</ref> values are used if the layer is   **! enlarged.   **! returns a new layer object   **! note:   **! The new layer object may have the same image object,
pike.git/src/modules/Image/layers.c:2825:    ADD_FUNCTION("create",image_layer_create,    tOr4(tFunc(tNone,tVoid),    tFunc(tObj tOr(tObj,tVoid) tOr(tString,tVoid),tVoid),    tFunc(tLayerMap,tVoid),    tFunc(tInt tInt    tOr(tColor,tVoid) tOr(tColor,tVoid),tVoid)),0);       ADD_FUNCTION("cast",image_layer_cast,    tFunc(tString,tMapping),0);    +  +  ADD_FUNCTION("clone",image_layer_clone, +  tFunc(,tObj),0); +     /* set */       ADD_FUNCTION("set_offset",image_layer_set_offset,tFunc(tInt tInt,tObj),0);    ADD_FUNCTION("set_image",image_layer_set_image,    tFunc(tOr(tObj,tVoid) tOr(tObj,tVoid),tObj),0);    ADD_FUNCTION("set_fill",image_layer_set_fill,    tFunc(tOr(tObj,tVoid) tOr(tObj,tVoid),tObj),0);    ADD_FUNCTION("set_mode",image_layer_set_mode,tFunc(tStr,tObj),0);    ADD_FUNCTION("set_alpha_value",image_layer_set_alpha_value,    tFunc(tFloat,tObj),0);