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.4 1999/04/19 18:34:37 mirar Exp $ + **! $Id: layers.c,v 1.5 1999/04/19 18:45:09 mirar Exp $   **! class Layer   */      #include "global.h"   #include <config.h>    - RCSID("$Id: layers.c,v 1.4 1999/04/19 18:34:37 mirar Exp $"); + RCSID("$Id: layers.c,v 1.5 1999/04/19 18:45:09 mirar Exp $");      #include "config.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:377:      static void image_layer_alpha_value(INT32 args)   {    pop_n_elems(args);    push_float(THIS->alpha_value);   }      /*   **! method object set_mode(string mode)   **! method string mode() + **! method array(string) available_modes()   **! Set/get layer mode. Mode is one of these:   **!   **! <tr><td valign=top align=left>   **! <b><tt>normal</tt><b></br>   **! ?   **! </td><td align=left valign=top>   **! <illustration> return lena(); </illustration>   **! <td></tr>   **!   **! <tr><td valign=top align=left>
pike.git/src/modules/Image/layers.c:505:   **! <illustration> return lena(); </illustration>   **! <td></tr>   **!   **! <tr><td valign=top align=left>   **! <b><tt>value</tt><b></br>   **! ?   **! </td><td align=left valign=top>   **! <illustration> return lena(); </illustration>   **! <td></tr>   **! + **! <ref>available_modes</ref>() simply gives an array + **! containing the names of these modes. + **!   **! note:   **! image and alpha channel must be of the same size,   **! or canceled.   */      static void image_layer_set_mode(INT32 args)   {    int i;    if (args!=1)    SIMPLE_TOO_FEW_ARGS_ERROR("Image.Layer->set_mode",1);
pike.git/src/modules/Image/layers.c:546:    for (i=0; i<LAYER_MODES; i++)    if (THIS->row_func==layer_mode[i].func)    {    ref_push_string(layer_mode[i].ps);    return;    }       fatal("illegal mode: %p\n",layer_mode[i].func);   }    + static void image_layer_available_modes(INT32 args) + { +  int i; +  pop_n_elems(args); +  +  for (i=0; i<LAYER_MODES; i++) +  ref_push_string(layer_mode[i].ps); +  +  f_aggregate(LAYER_MODES); + } +    /*   **! method object set_fill(Color color)   **! method object set_fill(Color color,Color alpha)   **! method object fill()   **! method object fill_alpha()   **! Set/query fill color and alpha, ie the color used "outside" the   **! image. This is mostly useful if you want to "frame"   **! a layer.   */   
pike.git/src/modules/Image/layers.c:1491:    resource_error(NULL,0,0,"memory",sizeof(rgb_group)*4*width,    "Out of memory.\n");    }       da=dest->alp->img;    d=dest->img->img;       /* loop over lines */    for (y=0; y<dest->ysize; y++)    { -  if (layers>1) +  if (layers>1 || layer[0]->row_func!=lm_normal)    {    /* add the bottom layer first */    if (layer[0]->row_func==lm_normal) /* cheat */    {    img_lay_first_line(layer[0],xoffs,xsize,    y+dest->yoffs-layer[0]->yoffs,    line1,aline1),z=1;    z=1;    }    else
pike.git/src/modules/Image/layers.c:1690:    ADD_FUNCTION("set_mode",image_layer_set_mode,tFunc(tStr,tObj),0);    ADD_FUNCTION("set_alpha_value",image_layer_set_mode,tFunc(tFloat,tObj),0);    ADD_FUNCTION("set_tiled",image_layer_set_tiled,tFunc(tInt,tObj),0);       /* query */       ADD_FUNCTION("image",image_layer_image,tFunc(,tObj),0);    ADD_FUNCTION("alpha",image_layer_alpha,tFunc(,tObj),0);    ADD_FUNCTION("mode",image_layer_mode,tFunc(,tStr),0);    +  ADD_FUNCTION("available_modes",image_layer_available_modes, +  tFunc(,tArr(tStr)),0); +     ADD_FUNCTION("xoffset",image_layer_xoffset,tFunc(,tInt),0);    ADD_FUNCTION("yoffset",image_layer_yoffset,tFunc(,tInt),0);       ADD_FUNCTION("alpha_value",image_layer_alpha_value,tFunc(,tFloat),0);    ADD_FUNCTION("fill",image_layer_fill,tFunc(,tObj),0);    ADD_FUNCTION("fill_alpha",image_layer_fill_alpha,tFunc(,tObj),0);       ADD_FUNCTION("tiled",image_layer_tiled,tFunc(,tInt01),0);       image_layer_program=end_program();