Class ImageryUtils

java.lang.Object
com.vividsolutions.jump.workbench.ui.plugin.imagery.ImageryUtils

public class ImageryUtils extends Object
  • Constructor Details

    • ImageryUtils

      public ImageryUtils()
  • Method Details

    • saveToTiff

      @Deprecated public static boolean saveToTiff(File tiffFile, BufferedImage bufferedImage)
      Deprecated.
      see IOTools.saveGeoTIFF(BufferedImage bufferedImage, Envelope envelope, File tiffFile)
      Save to Tiff
      Parameters:
      tiffFile - : ex. C:/Folder/file.tif
      bufferedImage - : BufferedImage from a layer
      Returns:
      true if the image has been saved
    • saveToPng

      public static boolean saveToPng(File pngFile, BufferedImage image)
      Save to PNG
      Parameters:
      pngFile - : ex. C:/Folder/file.png
      image - : BufferedImage from a layer
      Returns:
      true if the image has been saved
    • hasBeenModified

      public static boolean hasBeenModified(Layer layer)
      Check if ImageLayer has been modified
      Parameters:
      layer - the layer to test
      Returns:
      true if the layer has been modified
    • isCompatibleImageLayer

      public static boolean isCompatibleImageLayer(Layer layer)
      Check if the selected layer is BMP, JPG, GIF, PNG or TIF
      Parameters:
      layer - the layer to test
      Returns:
      true if layer has a well known image format
    • getBufferFromReferenceImageLayer2

      public static BufferedImage getBufferFromReferenceImageLayer2(Layer layer) throws IOException
      Get a bufferedImage from a ReferencedImage layer
      Parameters:
      layer - a ReferencedImage layer
      Returns:
      a BufferedImage
      Throws:
      IOException - if an IOException occurs while reading the image
    • getBufferFromReferenceImageLayer

      public static BufferedImage getBufferFromReferenceImageLayer(Layer layer) throws IOException
      Get a bufferedImage from a ReferencedImage layer
      Parameters:
      layer - a ReferencedImage layer
      Returns:
      a BufferedImage
      Throws:
      IOException - if an IOException occurred while reading the file
    • addAlphaChannel

      public static BufferedImage addAlphaChannel(BufferedImage image)
      Add an alpha channel to a BufferedImage
      Parameters:
      image - a BufferedImage
      Returns:
      the same BufferedImage with an alpha channel
    • resizeImage

      public static BufferedImage resizeImage(BufferedImage bufferedImage, int width, int height)
      Resize image
      Parameters:
      bufferedImage - a BufferedImage
      width - the width of the target image
      height - the height of the target image
      Returns:
      a new BufferedImage containing a resized version of the source image
    • resizeImage_test

      public static BufferedImage resizeImage_test(BufferedImage bufferedImage, int width, int height)
    • affineTransformation

      public static void affineTransformation(Layer layer, org.locationtech.jts.geom.util.AffineTransformation trans, boolean resizeImageToHalf) throws Exception
      Affine transformation of an image file loaded as ReferencedImageLayer.class
      Parameters:
      layer - a ReferencedImageLayer
      trans - the AffineTransformation to apply
      resizeImageToHalf - true to resize the image to half dimension
      Throws:
      Exception - if an Exception occurs during transformation
    • affineTransformation

      public static void affineTransformation(RasterImageLayer layer, org.locationtech.jts.geom.util.AffineTransformation trans, boolean resizeImageToHalf) throws Exception
      Affine transformation of an image file loaded as RasterImageLaye.class
      Parameters:
      layer - a RasterImageLayer
      trans - the AffineTransformation to apply to the image
      resizeImageToHalf - true to resize the image to half dimension
      Throws:
      Exception - if an Exception occurs during transformation