Class ImageryUtils
- java.lang.Object
-
- com.vividsolutions.jump.workbench.ui.plugin.imagery.ImageryUtils
-
public class ImageryUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ImageryUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BufferedImageaddAlphaChannel(BufferedImage image)Add an alpha channel to a BufferedImagestatic voidaffineTransformation(Layer layer, org.locationtech.jts.geom.util.AffineTransformation trans, boolean resizeImageToHalf)Affine transformation of an image file loaded as ReferencedImageLayer.classstatic voidaffineTransformation(RasterImageLayer layer, org.locationtech.jts.geom.util.AffineTransformation trans, boolean resizeImageToHalf)Affine transformation of an image file loaded as RasterImageLaye.classstatic BufferedImagegetBufferFromReferenceImageLayer(Layer layer)Get a bufferedImage from a ReferencedImage layerstatic BufferedImagegetBufferFromReferenceImageLayer2(Layer layer)Get a bufferedImage from a ReferencedImage layerstatic booleanhasBeenModified(Layer layer)Check if ImageLayer has been modifiedstatic booleanisCompatibleImageLayer(Layer layer)Check if the selected layer is BMP, JPG, GIF, PNG or TIFstatic BufferedImageresizeImage(BufferedImage bufferedImage, int width, int height)Resize imagestatic BufferedImageresizeImage_test(BufferedImage bufferedImage, int width, int height)static booleansaveToPng(File pngFile, BufferedImage image)Save to PNGstatic booleansaveToTiff(File tiffFile, BufferedImage bufferedImage)Deprecated.see IOTools.saveGeoTIFF(BufferedImage bufferedImage, Envelope envelope, File tiffFile)
-
-
-
Method Detail
-
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.tifbufferedImage- : 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.pngimage- : 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 BufferedImagewidth- the width of the target imageheight- 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 ReferencedImageLayertrans- the AffineTransformation to applyresizeImageToHalf- 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 RasterImageLayertrans- the AffineTransformation to apply to the imageresizeImageToHalf- true to resize the image to half dimension- Throws:
Exception- if an Exception occurs during transformation
-
-