Class ImageryUtils
java.lang.Object
com.vividsolutions.jump.workbench.ui.plugin.imagery.ImageryUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 BufferedImageGet a bufferedImage from a ReferencedImage layerstatic BufferedImageGet 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)
-
Constructor Details
-
ImageryUtils
public ImageryUtils()
-
-
Method Details
-
saveToTiff
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
Save to PNG- Parameters:
pngFile- : ex. C:/Folder/file.pngimage- : BufferedImage from a layer- Returns:
- true if the image has been saved
-
hasBeenModified
Check if ImageLayer has been modified- Parameters:
layer- the layer to test- Returns:
- true if the layer has been modified
-
isCompatibleImageLayer
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
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
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
Add an alpha channel to a BufferedImage- Parameters:
image- a BufferedImage- Returns:
- the same BufferedImage with an alpha channel
-
resizeImage
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
-
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
-