Package org.apache.fop.render

Examples of org.apache.fop.render.ImageHandlerRegistry


                    log.debug("Image " + info + " is inlined");
                }

                //Determine supported flavors
                ImageFlavor[] flavors;
                ImageHandlerRegistry imageHandlerRegistry
                    = userAgent.getFactory().getImageHandlerRegistry();
                flavors = imageHandlerRegistry.getSupportedFlavors(renderingContext);

                //Only now fully load/prepare the image
                Map hints = ImageUtil.getDefaultHints(sessionContext);
                org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                        info, flavors, hints, sessionContext);

                //Get handler for image
                ImageHandler basicHandler = imageHandlerRegistry.getHandler(renderingContext, img);

                //...and embed as inline image
                basicHandler.handleImage(renderingContext, img, targetRect);
            } else {
                if (log.isDebugEnabled()) {
View Full Code Here


        return formFlavor == null || !formFlavor.equals(inlineFlavor);
    }

    private static ImageFlavor[] determineSupportedImageFlavors(RenderingContext renderingContext) {
        ImageFlavor[] inlineFlavors;
        ImageHandlerRegistry imageHandlerRegistry
            = renderingContext.getUserAgent().getFactory().getImageHandlerRegistry();
        inlineFlavors = imageHandlerRegistry.getSupportedFlavors(renderingContext);
        return inlineFlavors;
    }
View Full Code Here

            //Create a rendering context for form creation
            PSRenderingContext formContext = new PSRenderingContext(
                    userAgent, gen, fontInfo, true);

            ImageFlavor[] flavors;
            ImageHandlerRegistry imageHandlerRegistry
                = userAgent.getFactory().getImageHandlerRegistry();
            flavors = imageHandlerRegistry.getSupportedFlavors(formContext);

            Map hints = ImageUtil.getDefaultHints(sessionContext);
            org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                    info, flavors, hints, sessionContext);

            ImageHandler basicHandler = imageHandlerRegistry.getHandler(formContext, img);
            if (basicHandler == null) {
                throw new UnsupportedOperationException(
                        "No ImageHandler available for image: "
                            + img.getInfo() + " (" + img.getClass().getName() + ")");
            }
View Full Code Here

        };
        this.colorSpaceCache = new ColorSpaceCache(foURIResolver);
        this.imageManager = new ImageManager(this);
        this.rendererFactory = new RendererFactory();
        this.xmlHandlers = new XMLHandlerRegistry();
        this.imageHandlers = new ImageHandlerRegistry();
        this.ignoredNamespaces = new java.util.HashSet();
    }
View Full Code Here

        };
        this.colorSpaceCache = new ColorSpaceCache(foURIResolver);
        this.imageManager = new ImageManager(this);
        this.rendererFactory = new RendererFactory();
        this.xmlHandlers = new XMLHandlerRegistry();
        this.imageHandlers = new ImageHandlerRegistry();
        this.ignoredNamespaces = new java.util.HashSet<String>();
    }
View Full Code Here

            //Create a rendering context for form creation
            PSRenderingContext formContext = new PSRenderingContext(
                    userAgent, gen, fontInfo, true);

            ImageFlavor[] flavors;
            ImageHandlerRegistry imageHandlerRegistry
                = userAgent.getFactory().getImageHandlerRegistry();
            flavors = imageHandlerRegistry.getSupportedFlavors(formContext);

            Map hints = ImageUtil.getDefaultHints(sessionContext);
            org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                    info, flavors, hints, sessionContext);

            ImageHandler basicHandler = imageHandlerRegistry.getHandler(formContext, img);
            if (basicHandler == null) {
                throw new UnsupportedOperationException(
                        "No ImageHandler available for image: "
                            + img.getInfo() + " (" + img.getClass().getName() + ")");
            }
View Full Code Here

     */
    protected void drawImageUsingImageHandler(ImageInfo info, Rectangle rect)
                    throws ImageException, IOException {
        ImageManager manager = getFopFactory().getImageManager();
        ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
        ImageHandlerRegistry imageHandlerRegistry = getFopFactory().getImageHandlerRegistry();

        //Load and convert the image to a supported format
        RenderingContext context = createRenderingContext();
        Map hints = createDefaultImageProcessingHints(sessionContext);
        context.putHints(hints);

        ImageFlavor[] flavors = imageHandlerRegistry.getSupportedFlavors(context);
        org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                    info, flavors,
                    hints, sessionContext);

        try {
View Full Code Here

     */
    protected void drawImage(Image image, Rectangle rect,
            RenderingContext context, boolean convert, Map additionalHints)
                    throws IOException, ImageException {
        ImageManager manager = getFopFactory().getImageManager();
        ImageHandlerRegistry imageHandlerRegistry = getFopFactory().getImageHandlerRegistry();

        Image effImage;
        context.putHints(additionalHints);
        if (convert) {
            Map hints = createDefaultImageProcessingHints(getUserAgent().getImageSessionContext());
            if (additionalHints != null) {
                hints.putAll(additionalHints);
            }
            effImage = manager.convertImage(image,
                    imageHandlerRegistry.getSupportedFlavors(context), hints);
        } else {
            effImage = image;
        }

        //First check for a dynamically registered handler
        ImageHandler handler = imageHandlerRegistry.getHandler(context, effImage);
        if (handler == null) {
            throw new UnsupportedOperationException(
                    "No ImageHandler available for image: "
                        + effImage.getInfo() + " (" + effImage.getClass().getName() + ")");
        }
View Full Code Here

     */
    protected void drawImageUsingImageHandler(ImageInfo info, Rectangle rect)
                    throws ImageException, IOException {
        ImageManager manager = getFopFactory().getImageManager();
        ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
        ImageHandlerRegistry imageHandlerRegistry = getFopFactory().getImageHandlerRegistry();

        //Load and convert the image to a supported format
        RenderingContext context = createRenderingContext();
        Map hints = createDefaultImageProcessingHints(sessionContext);
        context.putHints(hints);

        ImageFlavor[] flavors = imageHandlerRegistry.getSupportedFlavors(context);
        org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                    info, flavors,
                    hints, sessionContext);

        try {
View Full Code Here

     */
    protected void drawImage(Image image, Rectangle rect,
            RenderingContext context, boolean convert, Map additionalHints)
                    throws IOException, ImageException {
        ImageManager manager = getFopFactory().getImageManager();
        ImageHandlerRegistry imageHandlerRegistry = getFopFactory().getImageHandlerRegistry();

        Image effImage;
        context.putHints(additionalHints);
        if (convert) {
            Map hints = createDefaultImageProcessingHints(getUserAgent().getImageSessionContext());
            if (additionalHints != null) {
                hints.putAll(additionalHints);
            }
            effImage = manager.convertImage(image,
                    imageHandlerRegistry.getSupportedFlavors(context), hints);
        } else {
            effImage = image;
        }

        //First check for a dynamically registered handler
        ImageHandler handler = imageHandlerRegistry.getHandler(context, effImage);
        if (handler == null) {
            throw new UnsupportedOperationException(
                    "No ImageHandler available for image: "
                        + effImage.getInfo() + " (" + effImage.getClass().getName() + ")");
        }
View Full Code Here

TOP

Related Classes of org.apache.fop.render.ImageHandlerRegistry

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.