Examples of ImageObject


Examples of org.apache.fop.render.afp.modca.ImageObject

            //Serialize image
            writeImage(bi, baout);
            byte[] buf = baout.toByteArray();

            //Generate image
            ImageObject io = _afpDataStream.getImageObject(afpx, afpy, afpw, afph);
            io.setImageParameters(
                resolution, resolution,
                bi.getWidth(),
                bi.getHeight()
            );
            if (colorImages) {
                io.setImageIDESize((byte)24);
                io.setImageData(buf);
            } else {
                //TODO Teach it how to handle grayscale BufferedImages directly
                //because this is pretty inefficient
                convertToGrayScaleImage(io, buf, bi.getWidth(), bi.getHeight());
            }
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

                    int afpx = mpts2units(posInt.x + currentIPPosition);
                    int afpy = mpts2units(posInt.y + currentBPPosition);
                    int afpw = mpts2units(posInt.getWidth());
                    int afph = mpts2units(posInt.getHeight());
                    int afpres = getResolution();
                    ImageObject io = afpDataStream.getImageObject(afpx, afpy, afpw, afph,
                            afpres, afpres);
                    io.setImageParameters(
                            (int) (ccitt.getSize().getDpiHorizontal() * 10),
                            (int) (ccitt.getSize().getDpiVertical() * 10),
                            ccitt.getSize().getWidthPx(),
                            ccitt.getSize().getHeightPx());
                    int compression = ccitt.getCompression();
                    switch (compression) {
                    case TIFFImage.COMP_FAX_G3_1D :
                        io.setImageEncoding((byte) 0x80);
                        break;
                    case TIFFImage.COMP_FAX_G3_2D :
                        io.setImageEncoding((byte) 0x81);
                        break;
                    case TIFFImage.COMP_FAX_G4_2D :
                        io.setImageEncoding((byte) 0x82);
                        break;
                    default:
                        throw new IllegalStateException(
                                "Invalid compression scheme: " + compression);
                    }
                    InputStream in = ccitt.createInputStream();
                    try {
                        byte[] buf = IOUtils.toByteArray(in);
                        io.setImageData(buf);
                    } finally {
                        IOUtils.closeQuietly(in);
                    }
                } else if (img instanceof ImageXMLDOM) {
                    ImageXMLDOM imgXML = (ImageXMLDOM)img;
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

            //memory consumption (see PostScript output)
            writeImage(image, baout);
            byte[] buf = baout.toByteArray();

            // Generate image
            ImageObject io = afpDataStream.getImageObject(afpx, afpy, afpw,
                    afph, afpres, afpres);
            io.setImageParameters(imageResolution, imageResolution,
                    image.getWidth(), image.getHeight());
            if (colorImages) {
                io.setImageIDESize((byte)24);
                io.setImageData(buf);
            } else {
                // TODO Teach it how to handle grayscale BufferedImages directly
                // because this is pretty inefficient
                convertToGrayScaleImage(io, buf,
                        image.getWidth(), image.getHeight(), this.bitsPerPixel);
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

                    int afpx = mpts2units(posInt.x + currentIPPosition);
                    int afpy = mpts2units(posInt.y + currentBPPosition);
                    int afpw = mpts2units(posInt.getWidth());
                    int afph = mpts2units(posInt.getHeight());
                    int afpres = getResolution();
                    ImageObject io = afpDataStream.getImageObject(afpx, afpy, afpw, afph,
                            afpres, afpres);
                    io.setImageParameters(
                            (int) (ccitt.getSize().getDpiHorizontal() * 10),
                            (int) (ccitt.getSize().getDpiVertical() * 10),
                            ccitt.getSize().getWidthPx(),
                            ccitt.getSize().getHeightPx());
                    int compression = ccitt.getCompression();
                    switch (compression) {
                    case TIFFImage.COMP_FAX_G3_1D :
                        io.setImageEncoding((byte) 0x80);
                        break;
                    case TIFFImage.COMP_FAX_G3_2D :
                        io.setImageEncoding((byte) 0x81);
                        break;
                    case TIFFImage.COMP_FAX_G4_2D :
                        io.setImageEncoding((byte) 0x82);
                        break;
                    default:
                        throw new IllegalStateException(
                                "Invalid compression scheme: " + compression);
                    }
                    InputStream in = ccitt.createInputStream();
                    try {
                        byte[] buf = IOUtils.toByteArray(in);
                        io.setImageData(buf);
                    } finally {
                        IOUtils.closeQuietly(in);
                    }
                } else if (img instanceof ImageXMLDOM) {
                    ImageXMLDOM imgXML = (ImageXMLDOM)img;
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

            //memory consumption (see PostScript output)
            writeImage(image, baout);
            byte[] buf = baout.toByteArray();

            // Generate image
            ImageObject io = afpDataStream.getImageObject(afpx, afpy, afpw,
                    afph, afpres, afpres);
            io.setImageParameters(imageResolution, imageResolution,
                    image.getWidth(), image.getHeight());
            if (colorImages) {
                io.setImageIDESize((byte)24);
                io.setImageData(buf);
            } else {
                // TODO Teach it how to handle grayscale BufferedImages directly
                // because this is pretty inefficient
                convertToGrayScaleImage(io, buf,
                        image.getWidth(), image.getHeight(), this.bitsPerPixel);
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

                TIFFImage tiffImage = (TIFFImage) fopimage;
                int x = mpts2units(pos.getX() + currentIPPosition);
                int y = mpts2units(pos.getY() + currentBPPosition);
                int w = mpts2units(pos.getWidth());
                int h = mpts2units(pos.getHeight());
                ImageObject io = _afpDataStream.getImageObject(x, y, w, h);
                io.setImageParameters(
                    (int)(fopimage.getHorizontalResolution() * 10),
                    (int)(fopimage.getVerticalResolution() * 10),
                    fopimage.getWidth(),
                    fopimage.getHeight()
                );
                if (tiffImage.getStripCount() == 1) {
                    int comp = tiffImage.getCompression();
                    if (comp == 3) {
                        if (!fopimage.load(FopImage.ORIGINAL_DATA)) {
                            return;
                        }
                        io.setImageEncoding((byte)0x81);
                        io.setImageData(fopimage.getRessourceBytes());
                    } else if (comp == 4) {
                        if (!fopimage.load(FopImage.ORIGINAL_DATA)) {
                            return;
                        }
                        io.setImageEncoding((byte)0x82);
                        io.setImageData(fopimage.getRessourceBytes());
                    } else {
                        if (!fopimage.load(FopImage.BITMAP)) {
                            return;
                        }
                        convertToGrayScaleImage(io, fopimage.getBitmaps());
                    }
                } else {
                    if (!fopimage.load(FopImage.BITMAP)) {
                        return;
                    }
                    convertToGrayScaleImage(io, fopimage.getBitmaps());
                }
            } else {
                if (!fopimage.load(FopImage.BITMAP)) {
                    return;
                }
                fact.releaseImage(url, userAgent);

                int x = mpts2units(pos.getX() + currentIPPosition);
                int y = mpts2units(pos.getY() + currentBPPosition);
                int w = mpts2units(pos.getWidth());
                int h = mpts2units(pos.getHeight());
                ImageObject io = _afpDataStream.getImageObject(x, y, w, h);
                io.setImageParameters(
                    (int)(fopimage.getHorizontalResolution() * 10),
                    (int)(fopimage.getVerticalResolution() * 10),
                    fopimage.getWidth(),
                    fopimage.getHeight()
                );
                if (colorImages) {
                    io.setImageIDESize((byte)24);
                    io.setImageData(fopimage.getBitmaps());
                } else {
                    convertToGrayScaleImage(io, fopimage.getBitmaps());
                }
            }
        }
View Full Code Here

Examples of org.apache.fop.render.afp.modca.ImageObject

            //Serialize image
            writeImage(bi, baout);
            byte[] buf = baout.toByteArray();
           
            //Generate image
            ImageObject io = _afpDataStream.getImageObject(afpx, afpy, afpw, afph);
            io.setImageParameters(
                resolution, resolution,
                bi.getWidth(),
                bi.getHeight()
            );
            if (colorImages) {
                io.setImageIDESize((byte)24);
                io.setImageData(buf);
            } else {
                //TODO Teach it how to handle grayscale BufferedImages directly
                //because this is pretty inefficient
                convertToGrayScaleImage(io, buf);
            }
View Full Code Here

Examples of org.jpedal.render.ImageObject

                            //            obj[i]=textObject; //ALSO sets location

                            //example image object
                            /**/
                            type[i] = DynamicVectorRenderer.IMAGE;
                            ImageObject imgObject = new ImageObject(); //composite object so we can pass in parameters
                            imgObject.x = location.x + mX;
                            imgObject.y = location.y + mY;
                            imgObject.image = createUniqueImage(16, String.valueOf((i + 1)), col);
                            obj[i] = imgObject; //ALSO sets location

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.