Examples of ImageSize


Examples of org.apache.xmlgraphics.image.loader.ImageSize

                int width = wmfStore.getWidthUnits();
                int height = wmfStore.getHeightUnits();
                int dpi = wmfStore.getMetaFileUnitsPerInch();

                ImageInfo info = new ImageInfo(uri, "image/x-wmf");
                ImageSize size = new ImageSize();
                size.setSizeInPixels(width, height);
                size.setResolution(dpi);
                size.calcSizeFromPixels();
                info.setSize(size);
                ImageWMF img = new ImageWMF(info, wmfStore);
                info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, img);

                return info;
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        IndexColorModel cm = mock(IndexColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
        when(profile.getPDFAMode()).thenReturn(PDFAMode.PDFA_1A);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        ComponentColorModel cm = mock(ComponentColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        when(cm.getNumComponents()).thenReturn(3);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        ComponentColorModel cm = mock(ComponentColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        PDFDocument doc = mock(PDFDocument.class);
        PDFProfile profile = mock(PDFProfile.class);
        ImageRawPNGAdapter irpnga = new ImageRawPNGAdapter(irpng, "mock");
        ImageSize is = RawPNGTestUtil.getImageSize();

        when(irpng.getColorModel()).thenReturn(cm);
        when(cm.getNumComponents()).thenReturn(numComponents);
        // when(cm.hasAlpha()).thenReturn(false);
        when(doc.getProfile()).thenReturn(profile);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

            int widthMpt = (int)Math.round(px2mpt(width, context.getSourceResolution()));
            int heightMpt = (int)Math.round(px2mpt(height, context.getSourceResolution()));

            ImageInfo info = new ImageInfo(uri, MimeConstants.MIME_SVG);
            ImageSize size = new ImageSize();
            size.setSizeInMillipoints(widthMpt, heightMpt);
            //Set the resolution to that of the FOUserAgent
            size.setResolution(context.getSourceResolution());
            size.calcPixelsFromSize();
            info.setSize(size);

            //The whole image had to be loaded for this, so keep it
            ImageXMLDOM xmlImage = new ImageXMLDOM(info,
                    doc, BatikImageFlavors.SVG_DOM);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

    /**
     *
     * @return a default ImageSize
     */
    public static ImageSize getImageSize() {
        return new ImageSize(NUM_ROWS, NUM_COLUMNS, DPI);
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

    }

    private void testWriteToWithGRGBAPNG(int gray, int red, int green, int blue, int alpha)
            throws IOException {
        int numComponents = (gray > -1 ? 1 : 3) + (alpha > -1 ? 1 : 0);
        ImageSize is = RawPNGTestUtil.getImageSize();
        ComponentColorModel cm = mock(ComponentColorModel.class);
        when(cm.getNumComponents()).thenReturn(numComponents);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        when(irpng.getColorModel()).thenReturn(cm);
        when(irpng.getSize()).thenReturn(is);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        }
    }

    @Test
    public void testWriteToWithPalettePNG() throws IOException {
        ImageSize is = RawPNGTestUtil.getImageSize();
        IndexColorModel cm = mock(IndexColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        when(irpng.getColorModel()).thenReturn(cm);
        when(irpng.getSize()).thenReturn(is);
        ImageEncoderPNG iepng = new ImageEncoderPNG(irpng);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        assertArrayEquals(data, baos.toByteArray());
    }

    @Test
    public void testGetImplicitFilterWithIndexColorModel() {
        ImageSize is = RawPNGTestUtil.getImageSize();
        IndexColorModel cm = mock(IndexColorModel.class);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        when(irpng.getColorModel()).thenReturn(cm);
        when(irpng.getBitDepth()).thenReturn(8);
        when(irpng.getSize()).thenReturn(is);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.ImageSize

        assertEquals(expectedFilter, iepng.getImplicitFilter());
    }

    @Test
    public void testGetImplicitFilterWithComponentColorModel() {
        ImageSize is = RawPNGTestUtil.getImageSize();
        ComponentColorModel cm = mock(ComponentColorModel.class);
        when(cm.getNumComponents()).thenReturn(3);
        ImageRawPNG irpng = mock(ImageRawPNG.class);
        when(irpng.getColorModel()).thenReturn(cm);
        when(irpng.getBitDepth()).thenReturn(8);
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.