Package java.awt.image

Examples of java.awt.image.RenderedImage


    }

    public static void print(final ComboFrame frame, final Document doc, final PrintDoneCallback callback) {
        // Capture a preview image:
        Engine engine = doc.getEngine();
        RenderedImage image = engine.getRendering(new Dimension(400, 300));

        if (image instanceof PlanarImage) {
            image = ((PlanarImage) image).getAsBufferedImage();
        }
        // Restore the previous layout:
View Full Code Here


     * {@inheritDoc}
     */
    public RenderedImage getThumbnailImage( ImageInfo imageInfo )
        throws BadImageFileException, IOException, UnknownImageTypeException
    {
        final RenderedImage thumb = super.getThumbnailImage( imageInfo );
        final ImageMetadata metaData = imageInfo.getMetadata();
        final ImageOrientation orientation = metaData.getOrientation();
        final TransposeType transpose = orientation.getCorrection();
        if ( transpose == null )
            return thumb;
View Full Code Here

        } else {
            return;
        }

        // collect information
        RenderedImage image  = (RenderedImage) cached_tile.getOwner();

        final long tileSize    = cached_tile.getTileSize();
        final long timeStamp   = cached_tile.getTileTimeStamp();
        final long cacheHits   = lc_tile_cache.getCacheHitCount();
        final long cacheMisses = lc_tile_cache.getCacheMissCount();
        final long tileCount   = lc_tile_cache.getCacheTileCount();

        float memoryCapacity = (float) lc_tile_cache.getMemoryCapacity();
        float memoryUsage    = (float) lc_tile_cache.getCacheMemoryUsed();
        final int percentTCM = (int) ((100.0F * memoryUsage / memoryCapacity) + 0.5F);

        String jai_op;

        // image can be null if it was garbage collected
        if ( image != null ) {
            String temp = image.getClass().getName();
            jai_op = temp.substring(temp.lastIndexOf(".") + 1);
        } else {
            jai_op = "Op was removed by GC";
        }

View Full Code Here

        private double last_radius = 0;
        private double last_fuzz = 0;

        public PlanarImage setFront() {
            if (lastBack.get() != back || mask.get() == null || depth != last_radius || fuzz != last_fuzz) {
                RenderedImage singleChannel;
                if (back.getColorModel().getNumComponents() == 3) {
                    double[][] yChannel = new double[][]{{ColorScience.Wr, ColorScience.Wg, ColorScience.Wb, 0}};

                    ParameterBlock pb = new ParameterBlock();
                    pb.addSource( back );
View Full Code Here

        OutputStream out = new FileOutputStream(file);
        xmlDoc.write(out);
        out.close();

        // Add thumbnail data for the browser:
        RenderedImage thumb = engine.getRendering(new Dimension(320, 320));
        // divorce the preview from the document
        thumb = new CachedImage((PlanarImage) thumb, JAIContext.fileCache);
        ImageInfo info = ImageInfo.getInstanceFor(file);
        LZNImageType.INSTANCE.putImage(info, thumb);

        // Cache a high resolution preview:
        int size = PreviewUpdater.PreviewSize;
        RenderedImage preview = engine.getRendering(new Dimension(size, size));
        // divorce the preview from the document
        preview = new CachedImage((PlanarImage) preview, JAIContext.fileCache);
        PreviewUpdater.cachePreviewForImage(file, preview);
    }
View Full Code Here

            if (hasMask()) {
                PlanarImage labImage = Functions.toColorSpace(back, new LCMS_ColorSpace(new LCMS.LABProfile()),
                                                              LCMSColorConvertDescriptor.RELATIVE_COLORIMETRIC, null);
                // PlanarImage labImage = Functions.toColorSpace(back, JAIContext.labColorSpace, null);

                RenderedImage redMask = new RedMaskOpImage(labImage, tolerance, null);

                ParameterBlock pb;

                KernelJAI morphKernel = new KernelJAI(3, 3, new float[] {1, 1, 1, 1, 0, 1, 1, 1, 1});
                pb = new ParameterBlock();
View Full Code Here

    public synchronized RenderedImage getPreviewImage( int maxWidth,
                                                       int maxHeight )
        throws BadImageFileException, ColorProfileException, IOException,
               UnknownImageTypeException
    {
        RenderedImage strongRef = m_previewImageRef != null ?
            m_previewImageRef.get() : null;
        if ( strongRef == null ) {
            final ImageType t = getImageType();
            strongRef = t.getPreviewImage( this, maxWidth, maxHeight );
            if ( strongRef != null )
View Full Code Here

     */
    public synchronized RenderedImage getThumbnailImage()
        throws BadImageFileException, ColorProfileException, IOException,
               UnknownImageTypeException
    {
        RenderedImage strongRef = m_thumbnailImageRef != null ?
            m_thumbnailImageRef.get() : null;
        if ( strongRef == null ) {
            final ImageType t = getImageType();
            strongRef = t.getThumbnailImage( this );
            if ( strongRef != null )
View Full Code Here

        g.fill(clip);

        if (image != null) {
            AffineTransform xform = getTransform();

            RenderedImage xformedImage = image;
            if (!xform.isIdentity()) {
                RenderingHints extenderHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,
                                                                  BorderExtender.createInstance(BorderExtender.BORDER_COPY));
                ParameterBlock params = new ParameterBlock();
                params.addSource(image);
View Full Code Here

    public static void main(String[] args) throws Exception {
        InputStream in = new FileInputStream(args[0]);
        XmlDocument xml = new XmlDocument(in);
        Document doc = new Document(xml, null);
        RenderedImage image = doc.engine.getRendering(new Dimension(100, 100));
        ImageIO.write(image, "jpeg", new File("out.jpg"));
    }
View Full Code Here

TOP

Related Classes of java.awt.image.RenderedImage

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.