summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-03-20 04:32:12 +0100
committerSven Gothel <[email protected]>2013-03-20 04:32:12 +0100
commitbfe40bf3670731ef44ff4066c2a7119f1ab43bf8 (patch)
treee8105c318da0fcd78ead3941a2aed9912646859a /src
parent47a123169cf99bd9889caccb75c9be48d359d9a0 (diff)
TestPNGTextureFromFileNEWT: Use new PNG test file locations, add RGBA tests and use alpha in drawable
Diffstat (limited to 'src')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java164
1 files changed, 84 insertions, 80 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
index 15a0eec50..773b839a2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
@@ -61,72 +61,90 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
static boolean showFPS = false;
static long duration = 100; // ms
InputStream grayTextureStream;
- InputStream testTextureStreamN;
- InputStream testTextureStreamI;
- InputStream testTextureStreamIG;
- InputStream testTextureStreamPRGB;
- InputStream testTextureStreamPRGBA;/*
- InputStream testTextureStreamNRGBA;
- InputStream testTextureStreamIRGBA;*/
+
+ InputStream testTextureStreamN_3;
+ InputStream testTextureStreamN_4;
+ InputStream testTextureStreamNG4;
+
+ InputStream testTextureStreamI_3;
+ InputStream testTextureStreamIG3;
+ InputStream testTextureStreamI_4;
+ InputStream testTextureStreamIG4;
+
+ InputStream testTextureStreamP_3;
+ InputStream testTextureStreamP_4;
@Before
public void initTest() throws IOException {
grayTextureStream = TestPNGTextureFromFileNEWT.class.getResourceAsStream( "grayscale_texture.png" );
Assert.assertNotNull(grayTextureStream);
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN01-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
+ Assert.assertNotNull(testTextureUrlConn);
+ testTextureStreamN_3 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamN_3);
+ }
+ {
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_4-01-160x90.png");
+ Assert.assertNotNull(testTextureUrlConn);
+ testTextureStreamN_4 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamN_4);
+ }
+ {
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscNG4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamN = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamN);
+ testTextureStreamNG4 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamNG4);
}
+
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI01-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamI = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamI);
+ testTextureStreamI_3 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamI_3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG01-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamIG = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamIG);
+ testTextureStreamIG3 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamIG3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP301-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamPRGB = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamPRGB);
+ testTextureStreamI_4 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamI_4);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP401-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamPRGBA = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamPRGBA);
+ testTextureStreamIG4 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamIG4);
}
- /*{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN401-160x90.png");
+
+
+ {
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamNRGBA = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamNRGBA);
+ testTextureStreamP_3 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamP_3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI401-160x90.png");
+ URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
- testTextureStreamIRGBA = testTextureUrlConn.getInputStream();
- Assert.assertNotNull(testTextureStreamIRGBA);
- }*/
+ testTextureStreamP_4 = testTextureUrlConn.getInputStream();
+ Assert.assertNotNull(testTextureStreamP_4);
+ }
}
@After
public void cleanupTest() {
grayTextureStream = null;
- testTextureStreamN = null;
- testTextureStreamI = null;
- testTextureStreamIG = null;
- testTextureStreamPRGB = null;
- testTextureStreamPRGBA = null;/*
- testTextureStreamNRGBA = null;
- testTextureStreamIRGBA = null;*/
+ testTextureStreamN_3 = null;
+ testTextureStreamI_3 = null;
+ testTextureStreamIG3 = null;
+ testTextureStreamP_3 = null;
+ testTextureStreamP_4 = null;
}
public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
@@ -141,8 +159,10 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
return;
}
final GLCapabilities caps = new GLCapabilities(glp);
+ caps.setAlphaBits(1);
+
final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.PNG);
- System.err.println("TextureData: "+texData);
+ System.err.println("TextureData: "+texData);
final GLWindow glad = GLWindow.create(caps);
glad.setTitle("TestPNGTextureGL2FromFileNEWT");
@@ -187,76 +207,60 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
}
@Test
- public void testGrayPNGJLoaderGL2() throws InterruptedException, IOException {
+ public void testGray__GL2() throws InterruptedException, IOException {
testImpl(true, grayTextureStream);
}
@Test
- public void testGrayPNGJLoaderES2() throws InterruptedException, IOException {
+ public void testGray__ES2() throws InterruptedException, IOException {
testImpl(false, grayTextureStream);
}
@Test
- public void testTestN_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamN);
+ public void testRGB3__GL2() throws InterruptedException, IOException {
+ testImpl(true, testTextureStreamN_3);
}
@Test
- public void testTestN_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamN);
- }
-
- @Test
- public void testTestI_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamI);
+ public void testRGB3__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamN_3);
}
@Test
- public void testTestI_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamI);
- }
-
- @Test
- public void testTestIG_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamIG);
+ public void testRGB4__GL2() throws InterruptedException, IOException {
+ testImpl(true, testTextureStreamN_4);
}
@Test
- public void testTestIG_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamIG);
- }
-
- @Test
- public void testTestPRGB_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamPRGB);
+ public void testRGB4__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamN_4);
}
@Test
- public void testTestPRGB_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamPRGB);
+ public void testRGB4G_ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamNG4);
}
@Test
- public void testTestPRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamPRGBA);
+ public void testInterl3__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamI_3);
}
@Test
- public void testTestPRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamPRGBA);
+ public void testInterl4__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamI_4);
}
-
- /*@Test
- public void testTestNRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamNRGBA);
+ @Test
+ public void testInterl3G_ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamIG3);
}
@Test
- public void testTestNRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamNRGBA);
+ public void testInterl4G_ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamIG4);
}
@Test
- public void testTestIRGBA_PNGJLoaderGL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamIRGBA);
+ public void testPalette3__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamP_3);
}
@Test
- public void testTestIRGBA_PNGJLoaderES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamIRGBA);
- }*/
+ public void testPalette4__ES2() throws InterruptedException, IOException {
+ testImpl(false, testTextureStreamP_4);
+ }
public static void main(String args[]) throws IOException {
for(int i=0; i<args.length; i++) {