from gzz.vob import * from java.awt import Color from gzz.gfx.gl import GL, GLRen, GLCache, PaperMill execfile("test/gzz/gfx/gl/checkColor.py") def testPaperAnythingJava(): """Test that libpaper, when called through the Java API, renders anything. """ vs = getvs() vs.map.put(SolidBgVob(Color.black)) render(vs) checkAvgColor(100, 100, 2, 2, (0, 0, 0)) paper = PaperMill.getInstance().getPaper(42) pq = GLRen.createPaperQuad(paper, 0, 0, 1, 1, 1) vs.put(pq, 0, 100, 100, 200, 200) checkAvgColor(50, 50, 2, 2, (0, 0, 0)) checkAvgColor(150, 50, 2, 2, (0, 0, 0)) checkAvgColor(150, 350, 2, 2, (0, 0, 0)) checkAvgColor(350, 150, 2, 2, (0, 0, 0)) # And now, the crucial tests checkNotAvgColor(150, 150, 2, 2, (0,0,0), 30) checkNotAvgColor(250, 250, 2, 2, (0,0,0), 30) checkNotAvgColor(350, 250, 2, 2, (0,0,0), 30) # : vim: set syntax=python :