Package net.sourceforge.zbar

Examples of net.sourceforge.zbar.Image


{
    protected Image image;

    @Before public void setUp ()
    {
        image = new Image();
    }
View Full Code Here


    }


    @Test public void creation ()
    {
        Image img0 = new Image(123, 456);
        Image img1 = new Image("BGR3");
        Image img2 = new Image(987, 654, "UYVY");

        assertEquals(123, img0.getWidth());
        assertEquals(456, img0.getHeight());
        assertEquals(null, img0.getFormat());

        assertEquals(0, img1.getWidth());
        assertEquals(0, img1.getHeight());
        assertEquals("BGR3", img1.getFormat());

        assertEquals(987, img2.getWidth());
        assertEquals(654, img2.getHeight());
        assertEquals("UYVY", img2.getFormat());
    }
View Full Code Here

            rgb4[i] = c | (c << 8) | (c << 16) | (c << 24);
            exp[i] = (byte)c;
        }
        image.setData(rgb4);

        Image gray = image.convert("Y800");
        assertEquals(4, gray.getWidth());
        assertEquals(4, gray.getHeight());
        assertEquals("Y800", gray.getFormat());

        byte[] y800 = gray.getData();
        assertEquals(16, y800.length);

        assertArrayEquals(exp, y800);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.zbar.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.