Package org.apache.xmlgraphics.image.loader.impl

Examples of org.apache.xmlgraphics.image.loader.impl.ImageBuffered


                }
            }
        }

        if (ImageFlavor.BUFFERED_IMAGE.equals(this.targetFlavor)) {
            return new ImageBuffered(info, (BufferedImage)imageData, transparentColor);
        } else {
            return new ImageRendered(info, imageData, transparentColor);
        }
    }
View Full Code Here


                }
            }
        }
       
        if (ImageFlavor.BUFFERED_IMAGE.equals(this.targetFlavor)) {
            return new ImageBuffered(info, (BufferedImage)imageData, transparentColor);
        } else {
            return new ImageRendered(info, imageData, transparentColor);
        }
    }
View Full Code Here

        manager.getCache().setCacheListener(statistics);
       
        ImageInfo info = manager.getImageInfo(valid1, sessionContext);
        assertNotNull(info);
       
        ImageBuffered img1 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        assertNotNull(img1);
        assertNotNull(img1.getBufferedImage());
       
        ImageBuffered img2 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        //ImageBuffered does not have to be the same instance but we want at least the
        //BufferedImage to be reused.
        assertTrue("BufferedImage must be reused",
                img1.getBufferedImage() == img2.getBufferedImage());
       
        assertEquals(1, statistics.getImageCacheHits());
        assertEquals(1, statistics.getImageCacheMisses());
    }
View Full Code Here

        manager.getCache().setCacheListener(statistics);
       
        ImageInfo info = manager.getImageInfo(valid1, sessionContext);
        assertNotNull(info);
       
        ImageBuffered img1 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        assertNotNull(img1);
        assertNotNull(img1.getBufferedImage());
       
        ImageBuffered img2 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        //ImageBuffered does not have to be the same instance but we want at least the
        //BufferedImage to be reused.
        assertTrue("BufferedImage must be reused",
                img1.getBufferedImage() == img2.getBufferedImage());

        assertEquals(1, statistics.getImageCacheHits()); //1=BufferedImage
        assertEquals(3, statistics.getImageCacheMisses()); //3=BufferedImage,Graphics2DImage,DOM
    }
View Full Code Here

        String valid1 = "bgimg72dpi.gif";

        ImageInfo info = manager.getImageInfo(valid1, sessionContext);
        assertNotNull(info);

        ImageBuffered img1 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        assertNotNull(img1);
        assertNotNull(img1.getBufferedImage());

        ImageBuffered img2 = (ImageBuffered)manager.getImage(
                info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
        //ImageBuffered does not have to be the same instance but we want at least the
        //BufferedImage to be reused.
        assertTrue("BufferedImage must be reused",
                img1.getBufferedImage() == img2.getBufferedImage());

        assertEquals(1, statistics.getImageCacheHits());
        assertEquals(1, statistics.getImageCacheMisses());
    }
View Full Code Here

                }
            }
        }

        if (ImageFlavor.BUFFERED_IMAGE.equals(this.targetFlavor)) {
            return new ImageBuffered(info, (BufferedImage)imageData, transparentColor);
        } else {
            return new ImageRendered(info, imageData, transparentColor);
        }
    }
View Full Code Here

        ImageSize imgSize = new ImageSize();
        imgSize.setSizeInPixels(bi.getWidth(), bi.getHeight());
        imgSize.setResolution(72);
        imgInfo.setSize(imgSize);

        ImageBuffered img = new ImageBuffered(imgInfo, bi, null);
        PDFImage pdfimage = new ImageRenderedAdapter(img, resName);
        PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);

        PDF3DStream stream = annot.getStreamSafely();
        stream.addResource(resName, xobj);
View Full Code Here

                }
            }
        }
       
        if (ImageFlavor.BUFFERED_IMAGE.equals(this.targetFlavor)) {
            return new ImageBuffered(info, (BufferedImage)imageData, transparentColor);
        } else {
            return new ImageRendered(info, imageData, transparentColor);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.image.loader.impl.ImageBuffered

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.