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.57 2000/11/29 21:47:53 hubbe Exp $ + **! $Id: layers.c,v 1.58 2000/12/01 08:10:01 hubbe 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.57 2000/11/29 21:47:53 hubbe Exp $"); + RCSID("$Id: layers.c,v 1.58 2000/12/01 08:10:01 hubbe 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:524:      #define COMBINE_ALPHA_V(S,L,aS,aL,V) \    COMBINE_ALPHA(S,(L)*(V),aS,aL)      #define COMBINE_ALPHA_SUM(aS,aL) \    ((COLORTYPE)(COLORMAX*(C2F(aL)+(1.0-C2F(aL))*C2F(aS))))   #define COMBINE_ALPHA_SUM_V(aS,aL,V) \    COMBINE_ALPHA_SUM(aS,(aL)*(V))      #else /* unknown COMBINE_METHOD */ - #error unknown COMBINE_METHOD + #Pike_error unknown COMBINE_METHOD   #endif /* COMBINE_METHOD_FLOAT */      #endif      #define COMBINE(P,A) CCUT((DOUBLE_TO_INT(P))*(A))   #define COMBINE_A(P,A) (DOUBLE_TO_COLORTYPE((P)*(A)))   #define COMBINE_V(P,V,A) CCUT((V)*(P)*(A))      #define F2C(Z) (DOUBLE_TO_COLORTYPE(COLORMAX*(Z)))   
pike.git/src/modules/Image/layers.c:790:    "object(Image)|int(0)");    }       pop_n_elems(args);    ref_push_object(THISOBJ);   }      static void image_layer_get_misc_value( INT32 args )   {    if( args != 1 ) -  error("Wrong number of arguments to get_misc_value\n"); +  Pike_error("Wrong number of arguments to get_misc_value\n");    if( THIS->misc )    {    ref_push_mapping( THIS->misc );    stack_swap();    f_index( 2 );    } else {    pop_n_elems( args );    push_int( 0 );    }   }
pike.git/src/modules/Image/layers.c:813:   **! method mixed set_misc_value( mixed what, mixed to )   **! method mixed get_misc_value( mixed what )   **! Set or query misc. attributes for the layer.   **!   **! As an example, the XCF and PSD image decoders set the 'name' attribute   **! to the name the layer had in the source file.   */   static void image_layer_set_misc_value( INT32 args )   {    if( args != 2 ) -  error("Wrong number of arguments to set_misc_value\n"); +  Pike_error("Wrong number of arguments to set_misc_value\n");    if( !THIS->misc )    THIS->misc = allocate_mapping( 4 );       mapping_insert( THIS->misc, Pike_sp-2, Pike_sp-1 );    stack_swap();    pop_stack();   }      static void image_layer_image(INT32 args)   {
pike.git/src/modules/Image/layers.c:2758:    push_int(xi);    push_int(yi);    push_int(xz+xi-1);    push_int(yz+yi-1);    push_int(THIS->fill.r);    push_int(THIS->fill.g);    push_int(THIS->fill.b);    f_call_function(8);    if (Pike_sp[-1].type!=T_OBJECT ||    !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) -  error("No image returned from image->copy\n"); +  Pike_error("No image returned from image->copy\n");    if (img->xsize!=xz || img->ysize!=yz) -  error("Image returned from image->copy had " +  Pike_error("Image returned from image->copy had "    "unexpected size (%d,%d, expected %d,%d)\n",    img->xsize,img->ysize,xz,yz);       free_object(l->image);    l->image=Pike_sp[-1].u.object;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    l->img=img;    }   
pike.git/src/modules/Image/layers.c:2786:    push_int(xi);    push_int(yi);    push_int(xz+xi-1);    push_int(yz+yi-1);    push_int(THIS->fill_alpha.r);    push_int(THIS->fill_alpha.g);    push_int(THIS->fill_alpha.b);    f_call_function(8);    if (Pike_sp[-1].type!=T_OBJECT ||    !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) -  error("No image returned from alpha->copy\n"); +  Pike_error("No image returned from alpha->copy\n");    if (img->xsize!=xz || img->ysize!=yz) -  error("Image returned from alpha->copy had " +  Pike_error("Image returned from alpha->copy had "    "unexpected size (%d,%d, expected %d,%d)\n",    img->xsize,img->ysize,xz,yz);    free_object(l->alpha);    l->alpha=Pike_sp[-1].u.object;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    l->alp=img;    }       l->xoffs=x;