Example usage for org.apache.commons.imaging ImagingConstants BUFFERED_IMAGE_FACTORY

List of usage examples for org.apache.commons.imaging ImagingConstants BUFFERED_IMAGE_FACTORY

Introduction

In this page you can find the example usage for org.apache.commons.imaging ImagingConstants BUFFERED_IMAGE_FACTORY.

Prototype

String BUFFERED_IMAGE_FACTORY

To view the source code for org.apache.commons.imaging ImagingConstants BUFFERED_IMAGE_FACTORY.

Click Source Link

Usage

From source file:editeurpanovisu.ReadWriteImage.java

public static Image readTiff(String strNomFich) throws ImageReadException, IOException {
    File file = new File(strNomFich);
    final Map<String, Object> params = new HashMap<>();

    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());

    final BufferedImage img = Imaging.getBufferedImage(file, params);

    Image image = SwingFXUtils.toFXImage(img, null);

    return image;
}

From source file:org.apache.commons.imaging.examples.ImageReadExample.java

public static BufferedImage imageReadExample(final File file) throws ImageReadException, IOException {
    final Map<String, Object> params = new HashMap<>();

    // set optional parameters if you like
    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());

    // params.put(ImagingConstants.PARAM_KEY_VERBOSE, Boolean.TRUE);

    // read image
    final BufferedImage image = Imaging.getBufferedImage(file, params);

    return image;
}

From source file:org.github.jipsg.sanselan.BaseSanselanTest.java

@Override
public BufferedImage createBufferedImage(File file) throws Exception {
    final Map<String, Object> params = new HashMap<String, Object>();
    // set optional parameters if you like
    params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, new ManagedImageBufferedImageFactory());
    // read image
    return Imaging.getBufferedImage(file, params);
}