Java 8 ImageWriterSpi - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ImageWriterSpi class.

This code example shows how to use the following methods:createWriterInstance
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Getting a writer for tiff");
        } 
 
        // get a writer 
        final ImageWriter writer = writerSPI.createWriterInstance();
 
        // getting a stream caching in memory 
        final ImageOutputStream ioutstream = ImageIOExt.createImageOutputStream(image, outStream);
        if (ioutstream == null)
            throw new ServiceException("Unable to create ImageOutputStream."); 
 
        // tiff 
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Writing tiff image ...");
        } 
 
        // do we want it to be 8 bits? 
        image = applyPalette(image, mapContent, IMAGE_TIFF8, false);
 
5
CodeRank
This code example shows how to use the following methods:isStandardImageMetadataFormatSupported
        return delegateProvider.getExtraStreamMetadataFormatNames();
    } 
 
    @Override 
    public boolean isStandardImageMetadataFormatSupported() { 
        return delegateProvider.isStandardImageMetadataFormatSupported();
    } 
 
    @Override 
    public String getNativeImageMetadataFormatName() {
        return delegateProvider.getNativeImageMetadataFormatName();
    } 
 
    @Override 
    public String[] getExtraImageMetadataFormatNames() {
        return delegateProvider.getExtraImageMetadataFormatNames();
    } 
 
    @Override 
    public IIOMetadataFormat getStreamMetadataFormat(String formatName) {
3
CodeRank
This code example shows how to use the following methods:getDescription
		} 
		return null; 
	} 
 
	public String getDescription() {
		return spi.getDescription(Locale.getDefault());
	} 
 
	public String[] getExtensions() {
		return spi.getFileSuffixes();
	} 
 
	public String[] getMIMETypes() {
		return spi.getMIMETypes();
	} 
 
	public boolean hasOptionPanel() { 
		return true; 
	} 
 
4
CodeRank
This code example shows how to use the following methods:getFormatNames
        this.imageOutput = imageOutput;
    } 
 
    public static void write(final IIOImage image, final ImageWriterSpi provider, final ImageOutputStream imageOutput) throws IOException {
        // TODO: This is somewhat sketchy... 
        if (provider.getFormatNames()[0].equals("pam")) {
            new PAMHeaderWriter(imageOutput).writeHeader(image, provider);
        } 
        else if (provider.getFormatNames()[0].equals("pnm")) {
            new PNMHeaderWriter(imageOutput).writeHeader(image, provider);
        } 
        else { 
            throw new AssertionError("Unsupported provider: " + provider);
        } 
    } 
 
    public abstract void writeHeader(IIOImage image, final ImageWriterSpi provider) throws IOException;
 
    protected final int getWidth(final IIOImage image) {
        return image.hasRaster() ? image.getRaster().getWidth() : image.getRenderedImage().getWidth();
3
CodeRank
See Code Examples for Java 8 ImageWriterSpi Methods: