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.55 2000/08/15 12:44:50 grubba Exp $ + **! $Id: layers.c,v 1.56 2000/09/10 01:23:59 per 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.55 2000/08/15 12:44:50 grubba Exp $"); + RCSID("$Id: layers.c,v 1.56 2000/09/10 01:23:59 per 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:2883:   void image_layer_autocrop(INT32 args)   {    image_layer_find_autocrop(args);    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    push_array_items(Pike_sp->u.array); /* frees */    image_layer_crop(4);   }       + static void image_layer__sprintf( INT32 args ) + { +  extern void f_sprintf( INT32 args ); +  int x; +  if (args != 2 ) +  SIMPLE_TOO_FEW_ARGS_ERROR("_sprintf",2); +  if (sp[-args].type!=T_INT) +  SIMPLE_BAD_ARG_ERROR("_sprintf",0,"integer"); +  if (sp[1-args].type!=T_MAPPING) +  SIMPLE_BAD_ARG_ERROR("_sprintf",1,"mapping"); +  +  x = sp[-2].u.integer; +  +  pop_n_elems( 2 ); +  switch( x ) +  { +  case 't': +  push_constant_text("Image.Layer"); +  return; +  case 'O': +  push_constant_text( "Image.Layer(%O i=%O a=%O)" ); +  image_layer_mode(0); +  if( THIS->image ) ref_push_object( THIS->image ); else push_int( 0 ); +  if( THIS->alpha ) ref_push_object( THIS->alpha ); else push_int( 0 ); +  f_sprintf( 4 ); +  return; +  default: +  push_int(0); +  return; +  } + } +    /******************************************************/      void init_image_layers(void)   {    char buf[100];    char buf2[sizeof(INT32)];    int i;       for (i=0; i<LAYER_MODES; i++)    layer_mode[i].ps=make_shared_string(layer_mode[i].name);
pike.git/src/modules/Image/layers.c:2908:    set_exit_callback(exit_layer);          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("_sprintf",image_layer__sprintf, +  tFunc(tInt tMapping,tString),0);    ADD_FUNCTION("cast",image_layer_cast,    tFunc(tString,tMapping),0);          ADD_FUNCTION("clone",image_layer_clone,    tFunc(tNone,tObj),0);       /* set */       ADD_FUNCTION("set_offset",image_layer_set_offset,tFunc(tInt tInt,tObj),0);