Example usage for java.awt.image RenderedImage getClass

List of usage examples for java.awt.image RenderedImage getClass

Introduction

In this page you can find the example usage for java.awt.image RenderedImage getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.esa.beam.visat.toolviews.diag.TileCacheMonitor.java

private String getImageName(RenderedImage image) {
    return image.getClass().getSimpleName();
}

From source file:org.apache.xmlgraphics.ps.PSImageUtils.java

/**
 * Writes a bitmap image to the PostScript stream.
 * @param img the bitmap image as a byte array
 * @param targetRect the target rectangle to place the image in
 * @param gen the PostScript generator/*from  w ww .ja v  a2 s.co  m*/
 * @throws IOException In case of an I/O exception
 */
private static void writeImage(RenderedImage img, Rectangle2D targetRect, PSGenerator gen) throws IOException {
    ImageEncoder encoder = ImageEncodingHelper.createRenderedImageEncoder(img);
    String imgDescription = img.getClass().getName();

    gen.saveGraphicsState();
    translateAndScale(gen, null, targetRect);

    gen.commentln("%AXGBeginBitmap: " + imgDescription);

    gen.writeln("{{");
    // Template: (RawData is used for the EOF signal only)
    // gen.write("/RawData currentfile <first filter> filter def");
    // gen.write("/Data RawData <second filter> <third filter> [...] def");
    String implicitFilter = encoder.getImplicitFilter();
    if (implicitFilter != null) {
        gen.writeln("/RawData currentfile /ASCII85Decode filter def");
        gen.writeln("/Data RawData " + implicitFilter + " filter def");
    } else {
        if (gen.getPSLevel() >= 3) {
            gen.writeln("/RawData currentfile /ASCII85Decode filter def");
            gen.writeln("/Data RawData /FlateDecode filter def");
        } else {
            gen.writeln("/RawData currentfile /ASCII85Decode filter def");
            gen.writeln("/Data RawData /RunLengthDecode filter def");
        }
    }
    PSDictionary imageDict = new PSDictionary();
    imageDict.put("/DataSource", "Data");
    writeImageCommand(img, imageDict, gen);

    /* the following two lines could be enabled if something still goes wrong
     * gen.write("Data closefile");
     * gen.write("RawData flushfile");
     */
    gen.writeln("} stopped {handleerror} if");
    gen.writeln("  RawData flushfile");
    gen.writeln("} exec");

    compressAndWriteBitmap(encoder, gen);

    gen.writeln("");
    gen.commentln("%AXGEndBitmap");
    gen.restoreGraphicsState();
}

From source file:org.geoserver.wcs.responses.GeoTiffWriterHelper.java

/**
 * Returns true if the coverage has not been processed in any way since it has been read
 * /* ww  w.  j  av a 2 s .  c  o m*/
 * @param coverage
 *
 */
private boolean isUnprocessed(GridCoverage2D coverage) {
    RenderedImage ri = coverage.getRenderedImage();
    if (ri instanceof RenderedOp) {
        RenderedOp op = (RenderedOp) ri;
        return op.getOperationName().startsWith("ImageRead");
    } else if (ri instanceof OpImage) {
        return ri.getClass().getSimpleName().startsWith("ImageRead");
    } else {
        return true;
    }
}

From source file:org.photovault.image.PhotovaultImage.java

private void debugPrintGraph(RenderedImage img, String prefix) {
    Object opName = img.getProperty("org.photovault.opname");
    if (opName != null && opName instanceof String) {
        System.out.println(prefix + opName + " (" + img.getClass().getName() + ")");
    } else {/*w  ww . j  a v a 2s  .c  o  m*/
        System.out.println(prefix + "unnamed image" + " (" + img.getClass().getName() + ")");
    }

    System.out.println(prefix + "  " + img.toString());
    if (img instanceof RenderedOp) {
        RenderedOp op = (RenderedOp) img;
        System.out.println(prefix + "  operation name" + op.getOperationName());
        ParameterBlock pb = op.getParameterBlock();
        if (pb instanceof ParameterBlockJAI) {
            ParameterBlockJAI pbj = (ParameterBlockJAI) pb;
            String[] paramNames = pbj.getParameterListDescriptor().getParamNames();
            Vector params = pbj.getParameters();
            for (int n = 0; n < paramNames.length; n++) {
                System.out.println(prefix + "  " + paramNames[n] + params.get(n));
            }
        }
    }
    Vector<RenderedImage> sources = img.getSources();
    if (sources == null) {
        return;
    }
    for (RenderedImage parent : sources) {
        debugPrintGraph(parent, prefix + "    ");
    }
}