pike.git
/
src
/
modules
/
Image
/
testsuite.in.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/testsuite.in.in:271:
//----------------------------------------------------- #chapter Image.Colortable #test colortable - black/white init & cast object c=Image.Colortable(({Image.Color.white,Image.Color.black})); array z=(array)c; if (sizeof(z)!=2) fail("didn't get two colors (black and white): "+((array(string))c)*", "); if ((z[0]!=Image.Color.black || z[1]!=Image.Color.white) && (z[1]!=Image.Color.black || z[0]!=Image.Color.white))
-
fail("didn't get black and white: "+((array(string))
c
)*", ");
+
fail("didn't get black and white: "+((array(string))
z
)*", ");
ok(); #test colortable - black/white normal object img=Image.image(100,100)->test(43); object c=Image.Colortable(({Image.Color.white,Image.Color.black})); img=c*img; array z=(array)Image.Colortable(img); if (sizeof(z)!=2)
-
fail("didn't get two colors (black and white): "+((array(string))
c
)*", ");
-
if ((z[0]!=Image.Color.black ||
z[1
]!=Image.Color.white) &&
+
fail("didn't get two colors (black and white): "+((array(string))
z
)*", ");
+
if ((z[0]!=Image.Color.black ||
z1
]!=Image.Color.white) &&
(z[1]!=Image.Color.black || z[0]!=Image.Color.white))
-
fail("didn't get black and white: "+((array(string))
c
)*", ");
+
fail("didn't get black and white: "+((array(string))
z
)*", ");
ok(); #test colortable - black/white floyd-steinberg object img=Image.image(100,100)->test(43); object c=Image.Colortable(({Image.Color.white,Image.Color.black})); c->floyd_steinberg(); img=c*img; array z=(array)Image.Colortable(img); if (sizeof(z)!=2)
-
fail("didn't get two colors (black and white): "+((array(string))
c
)*", ");
+
fail("didn't get two colors (black and white): "+((array(string))
z
)*", ");
if ((z[0]!=Image.Color.black || z[1]!=Image.Color.white) && (z[1]!=Image.Color.black || z[0]!=Image.Color.white))
-
fail("didn't get black and white: "+((array(string))
c
)*", ");
+
fail("didn't get black and white: "+((array(string))
z
)*", ");
ok(); #test colortable - black/white ordered object img=Image.image(100,100)->test(43); object c=Image.Colortable(({Image.Color.white,Image.Color.black})); c->ordered(); img=c*img; array z=(array)Image.Colortable(img); if (sizeof(z)!=2)
-
fail("didn't get two colors (black and white): "+((array(string))
c
)*", ");
+
fail("didn't get two colors (black and white): "+((array(string))
z
)*", ");
if ((z[0]!=Image.Color.black || z[1]!=Image.Color.white) && (z[1]!=Image.Color.black || z[0]!=Image.Color.white))
-
fail("didn't get black and white: "+((array(string))
c
)*", ");
+
fail("didn't get black and white: "+((array(string))
z
)*", ");
ok(); #test colortable - standard object img=Image.image(200,200)->test(42); img->tuned_box(50,50,150,150,({({0,0,0}),({255,0,0}),({0,255,0}),({0,0,255})})); object c=Image.Colortable(img,1000)->cubicles(16,16,16,4); if (sizeof(c)<200) fail("too few colors"); object img1=(c*img); if (!(img-img1<50)) fail("differ too much ("+(img-img1)->max()[0]+","+(img-img1)->max()[1]+","+(img-img1)->max()[2]+","+")"); ok();