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.72 2001/07/19 21:10:56 nilsson Exp $ + **! $Id: layers.c,v 1.73 2001/07/27 15:20:45 nilsson Exp $   **! class Layer   **! see also: layers   **!      **!   **!   **! appendix Image.Layer modes   **!   **! <dl compact>   **! <dt><i>The variables in the expression:</i></dt>
pike.git/src/modules/Image/layers.c:22:   **! </dl>   **! <i>All channels are calculated separately, if nothing else is specified.</i>   **! <execute>   **! import Image;   **!   **! void write_image(string desc,   **! string filename,   **! Image img,   **! string longdesc)   **! { - **! begin_tag("tr"); + **! longdesc = replace(longdesc, ([ "&lt;":"&amp;lt;", "&gt;":"&amp;gt;", "&amp;":"&amp;amp;" ])); + **! write(begin_tag("tr"));   **! write(mktag("td",(["align":"right","valign":"center"]),   **! mktag("b",0,desc)));   **! write(mktag("td",(["align":"right"]),illustration_jpeg(img,(["dpi":150.0]))));   **! write(mktag("td",(["align":"left","valign":"center"]),longdesc));   ** (replace(longdesc,({",",";",")"}),   ** ({",<wbr>",";<wbr>",")<wbr>"}))/   ** "<wbr>")/1*({mktag("wbr")}) ) ); - **! write(end_tag()); + **! write(end_tag()+"\n");   **! }   **!   **! int main()   **! {   **! object ltrans=Layer((["image":   **! Image(32,32,160,160,160)->   **! box(0,0,15,15,96,96,96)->   **! box(16,16,31,31,96,96,96)->scale(0.5),   **! "tiled":1,   **! "mode":"normal"]));   **! - **! object circle=load("circle50.pnm"); - **! object image_test=load("image_ill.pnm"); - **! object ryoki=load_layer("ryoki_carrot.png"); + **! object circle=load(fix_image_path("circle50.pnm")); + **! object image_test=load(fix_image_path("image_ill.pnm")); + **! object ryoki=load_layer(fix_image_path("ryoki_carrot.png"));   **!   **! object lc1=   **! Layer((["image":circle->clear(255,0,0),   **! "alpha":circle,   **! "xoffset":5,   **! "yoffset":5]));   **!   **! object lc2=   **! Layer((["image":circle->clear(0,0,255),   **! "alpha":circle,
pike.git/src/modules/Image/layers.c:160:   **! lay( ({ lay(({lc2}),0,0,80,80),   **! lay(({lc2b}),0,0,80,80)->set_offset(80,0),   **! lay(({li2}),0,0,80,80)->set_offset(160,0),   **! lay(({li2b}),0,0,80,80)->set_offset(240,0),   **! lay(({lr2}),0,0,80,80)->set_offset(320,0),   **! lzo1->set_offset(400,0)}),   **! 0,0,560,80);   **!   ** xv(a); xv(b);   **! - **! begin_tag("table",(["cellspacing":"0","cellpadding":"1"])); + **! write(begin_tag("table",(["cellspacing":"0","cellpadding":"1"])));   **!   **! // write_image("top layer image","bi",b->image());   **! // write_image("top layer alpha","ba",b->alpha());   **!   **! // write_image("bottom layer image","ai",a->image());   **! // write_image("bottom layer alpha","aa",b->alpha());   **!   **! write_image("top layer","b",lay(({ltrans,b}))->image(),   **! "");   **! write_image("bottom layer","a",lay(({ltrans,a}))->image(),
pike.git/src/modules/Image/layers.c:209:   **! return 0;   **! }   **!   **! </execute>   */      #include "global.h"      #include <math.h> /* floor */    - RCSID("$Id: layers.c,v 1.72 2001/07/19 21:10:56 nilsson Exp $"); + RCSID("$Id: layers.c,v 1.73 2001/07/27 15:20:45 nilsson 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"