Skip to content
Snippets Groups Projects
Commit 89700af0 authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

...

Rev: lib/master.pike:1.4
Rev: src/modules/image/blit.c:1.4
Rev: src/modules/image/doc/image.html:1.7
parent 1930968c
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,11 @@ void create() ...@@ -24,6 +24,11 @@ void create()
add_constant("mkmultiset",lambda(mixed *a) { return aggregate_multiset(@a); }); add_constant("mkmultiset",lambda(mixed *a) { return aggregate_multiset(@a); });
add_constant("strlen",sizeof); add_constant("strlen",sizeof);
add_constant("clone",lambda(program p,mixed ... a)
{ return p(@a); } );
add_constant("new",lambda(program p,mixed ... a)
{ return p(@a); } );
random_seed(time() + (getpid() * 0x11111111)); random_seed(time() + (getpid() * 0x11111111));
} }
...@@ -103,7 +108,7 @@ object cast_to_object(string oname) ...@@ -103,7 +108,7 @@ object cast_to_object(string oname)
if(ret=objects[oname]) return ret; if(ret=objects[oname]) return ret;
return objects[oname]=clone(cast_to_program(oname)); return objects[oname]=cast_to_program(oname)();
} }
mapping (string:string) environment=([]); mapping (string:string) environment=([]);
...@@ -136,7 +141,7 @@ void _main(string *argv, string *env) ...@@ -136,7 +141,7 @@ void _main(string *argv, string *env)
add_constant("getenv",getenv); add_constant("getenv",getenv);
add_constant("putenv",putenv); add_constant("putenv",putenv);
add_constant("write",clone(cast_to_program("/precompiled/file"),"stdout")->write); add_constant("write",cast_to_program("/precompiled/file")("stdout")->write);
a=backtrace()[-1][0]; a=backtrace()[-1][0];
q=a/"/"; q=a/"/";
......
...@@ -213,7 +213,6 @@ void image_paste(INT32 args) ...@@ -213,7 +213,6 @@ void image_paste(INT32 args)
y1=sp[2-args].u.integer; y1=sp[2-args].u.integer;
} }
else x1=y1=0; else x1=y1=0;
pop_n_elems(args-1);
x2=x1+img->xsize-1; x2=x1+img->xsize-1;
y2=y1+img->ysize-1; y2=y1+img->ysize-1;
...@@ -227,6 +226,10 @@ void image_paste(INT32 args) ...@@ -227,6 +226,10 @@ void image_paste(INT32 args)
blitheight, blitheight,
THIS->xsize, THIS->xsize,
img->xsize); img->xsize);
pop_n_elems(args);
THISOBJ->refs++;
push_object(THISOBJ);
} }
void image_paste_alpha(INT32 args) void image_paste_alpha(INT32 args)
......
...@@ -557,4 +557,10 @@ object image->skewx_expand(int diff,rgb); ...@@ -557,4 +557,10 @@ object image->skewx_expand(int diff,rgb);
object image->skewy_expand(int diff,rgb); object image->skewy_expand(int diff,rgb);
object image->rotate(int|float angle,rgb); object image->rotate(int|float angle,rgb);
object image->rotate_expand(int|float angle,rgb); object image->rotate_expand(int|float angle,rgb);
object image->turbulence(colorrange,int octaves=3,float scale=1,
float xdiff=0,float ydiff=0,float cscale=1);
object image->noise(colorrange,float scale=0.1,
float xdiff=0,float ydiff=0,float cscale=1);
where colorrange is ({ float position=0..1, ({r,g,b}),
float position=0..1, ({r,g,b}), ... })
</pre> </pre>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment