Example usage for javax.imageio ImageWriteParam canWriteTiles

List of usage examples for javax.imageio ImageWriteParam canWriteTiles

Introduction

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

Prototype

boolean canWriteTiles

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

Click Source Link

Document

A boolean that is true if this ImageWriteParam allows tile width and tile height parameters to be set.

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(),/* w w w . j  a v  a  2  s.c  o m*/
                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  av  a2 s . com*/
    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("-----------------------------");
    }
}