Package com.alibaba.simpleimage

Examples of com.alibaba.simpleimage.ImageRender


     * {@link com.alibaba.simpleimage.render.WriteRender#WriteRender(javax.media.jai.PlanarImage, java.io.OutputStream, java.lang.String)}
     * .
     */
    public void testWriteRenderPlanarImageOutputStreamString() throws Exception {
        OutputStream output = null;
        ImageRender wr = null;
        try {
            output = new FileOutputStream(new File(resultDir, "WRITE_st.jpg"));
            wr = new WriteRender(getImage(), output);

            wr.render();
        } finally {
            if (wr != null) {
                wr.dispose();
            }
            IOUtils.closeQuietly(output);
        }
    }
View Full Code Here


     * Test method for
     * {@link com.alibaba.simpleimage.render.WriteRender#WriteRender(javax.media.jai.PlanarImage, java.io.File, java.lang.String)}
     * .
     */
    public void testWriteRenderPlanarImageFileString() throws Exception {
        ImageRender wr = null;
        try {
            File file = new File(resultDir, "WRITE_st.jpg");
            wr = new WriteRender(getImage(), file);

            wr.render();
        } finally {
            if (wr != null) {
                wr.dispose();
            }
        }
    }
View Full Code Here

     * Test method for
     * {@link com.alibaba.simpleimage.render.WriteRender#WriteRender(javax.media.jai.PlanarImage, java.lang.String, java.lang.String)}
     * .
     */
    public void testWriteRenderPlanarImageStringString() throws Exception {
        ImageRender wr = null;
        try {
            wr = new WriteRender(getImage(), path.getCanonicalPath() + File.separator
                    + "WRITE_st.jpg");

            wr.render();
        } finally {
            if (wr != null) {
                wr.dispose();
            }
        }
    }
View Full Code Here

     * .
     */
    public void testWriteRenderImageRenderOutputStreamString() throws Exception {
        OutputStream output = null;
        InputStream input = null;
        ImageRender wr = null;
        try {
            output = new FileOutputStream(path.getCanonicalPath() + File.separator
                    + "WRITE_st.jpg");
            input = new FileInputStream(new File(path, "st.jpg"));
            ImageRender rr = new ReadRender(input);
            wr = new WriteRender(rr, output);

            wr.render();
        } finally {
            if (wr != null) {
View Full Code Here

     */
    public void testWriteRenderImageRenderFileString() throws Exception {
        File file = new File(path.getCanonicalPath() + File.separator + "WRITE_st.jpg");

        InputStream input = null;
        ImageRender wr = null;
        try {
            input = new FileInputStream(new File(path, "st.jpg"));
            ImageRender rr = new ReadRender(input);
            wr = new WriteRender(rr, file);

            wr.render();
        } finally {
            if (wr != null) {
View Full Code Here

     */
    public void testWriteRenderImageRenderStringString() throws Exception {
        String output = path.getCanonicalPath() + File.separator + "WRITE_st.jpg";

        InputStream input = null;
        ImageRender wr = null;
        try {
            input = new FileInputStream(new File(path, "st.jpg"));
            ImageRender rr = new ReadRender(input);
            wr = new WriteRender(rr, output);

            wr.render();
        } finally {
            if (wr != null) {
View Full Code Here

     */
    public void testReadRenderInputStreamBoolean() throws Exception {
        File file = new File(path, "334.jpg");
        InputStream input = null;
        ImageWrapper img = null;
        ImageRender rr = null;

        try {
            input = new FileInputStream(file);
            rr = new ReadRender(input, true);
            img = rr.render();
            assertNotNull(img);

        } finally {
            IOUtils.closeQuietly(input);
            if (rr != null) {
                rr.dispose();
            }
        }
    }
View Full Code Here

   
    private ImageWrapper read(File dir, String filename) throws Exception {
        File file = new File(dir, filename);
        InputStream input = null;
        ImageWrapper img = null;
        ImageRender rr = null;

        try {
            input = new FileInputStream(file);
            rr = new ReadRender(input);
            img = rr.render();
           
            return img;
        } finally {
            IOUtils.closeQuietly(input);
            if (rr != null) {
                rr.dispose();
            }
        }
    }
View Full Code Here

     */
    public void testReadRenderInputStream() throws Exception {
        File file = new File(path, "334.jpg");
        InputStream input = null;
        ImageWrapper img = null;
        ImageRender rr = null;

        try {
            input = new FileInputStream(file);
            rr = new ReadRender(input);
            img = rr.render();
            assertNotNull(img);

        } finally {
            IOUtils.closeQuietly(input);
            if (rr != null) {
                rr.dispose();
            }
        }
    }
View Full Code Here

        assertEquals(param.getAlgorithm(), ScaleParameter.Algorithm.AUTO);
    }
   
    public void write(ImageRender sr) throws Exception {
        OutputStream output = null;
        ImageRender wr = null;
        try {
            output = new FileOutputStream(new File("./src/test/resources/conf.test/simpleimage/result/snow-result.jpg"));
            wr = new WriteRender(sr, output, ImageFormat.JPEG);
            wr.render();
        } finally {
            if (wr != null) {
                wr.dispose();
            }
            IOUtils.closeQuietly(output);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.simpleimage.ImageRender

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.