Example usage for javax.imageio ImageWriteParam canWriteProgressive

List of usage examples for javax.imageio ImageWriteParam canWriteProgressive

Introduction

In this page you can find the example usage for javax.imageio ImageWriteParam canWriteProgressive.

Prototype

boolean canWriteProgressive

To view the source code for javax.imageio ImageWriteParam canWriteProgressive.

Click Source Link

Document

A boolean that is true if this ImageWriteParam allows images to be written as a progressive sequence of increasing quality passes.

Usage

From source file:org.dcm4che.tool.dcm2jpg.Dcm2Jpg.java

public static void listSupportedImageWriters(String format) {
    System.out.println(MessageFormat.format(rb.getString("writers"), format));
    Iterator<ImageWriter> it = ImageIO.getImageWritersByFormatName(format);
    while (it.hasNext()) {
        ImageWriter writer = it.next();
        ImageWriteParam param = writer.getDefaultWriteParam();
        System.out.println(MessageFormat.format(rb.getString("writer"), writer.getClass().getName(),
                param.canWriteCompressed(), param.canWriteProgressive(), param.canWriteTiles(),
                param.canOffsetTiles(),//from   w  w w.j a  va 2s  .com
                param.canWriteCompressed() ? Arrays.toString(param.getCompressionTypes()) : null));
    }
}

From source file:org.dcm4che2.tool.dcm2jpg.Dcm2Jpg.java

private void showImageWriters() {
    ImageWriter writer;/*from   w  w w  . j  a v a  2 s .c  o  m*/
    System.out.println("ImageWriters for format name:" + formatName);
    int i = 0;
    for (Iterator<ImageWriter> it = ImageIO.getImageWritersByFormatName(formatName); it.hasNext();) {
        writer = it.next();
        System.out.println("Writer[" + (i++) + "]: " + writer.getClass().getName() + ":");
        System.out.println("   Write Param:");
        ImageWriteParam param = writer.getDefaultWriteParam();
        System.out.println("       canWriteCompressed:" + param.canWriteCompressed());
        System.out.println("      canWriteProgressive:" + param.canWriteProgressive());
        System.out.println("            canWriteTiles:" + param.canWriteTiles());
        System.out.println("           canOffsetTiles:" + param.canOffsetTiles());
        if (param.canWriteCompressed()) {
            String[] types = param.getCompressionTypes();
            System.out.println("   Compression Types:");
            if (types != null && types.length > 0) {
                for (int j = 0; j < types.length; j++) {
                    System.out.println("           Type[" + j + "]:" + types[j]);
                }
            }
        }
        System.out.println("-----------------------------");
    }
}