Package org.openstreetmap.josm.tools
Class ImageWarp
- java.lang.Object
-
- org.openstreetmap.josm.tools.ImageWarp
-
public final class ImageWarp extends java.lang.Object
Image warping algorithm.Deforms an image geometrically according to a given transformation formula.
- Since:
- 11858
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageWarp.GridTransform
Wrapper that optimizes a givenImageWarp.PointTransform
.static class
ImageWarp.Interpolation
Interpolation method.static interface
ImageWarp.PointTransform
Transformation that translates the pixel coordinates.
-
Constructor Summary
Constructors Modifier Constructor Description private
ImageWarp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int
getColor(int x, int y, java.awt.image.BufferedImage img, java.lang.Object sharedArray)
private static java.lang.Object
getSharedArray(java.awt.image.BufferedImage srcImg)
static java.awt.image.BufferedImage
warp(java.awt.image.BufferedImage srcImg, java.awt.Dimension targetDim, ImageWarp.PointTransform invTransform, ImageWarp.Interpolation interpolation)
Warp an image.
-
-
-
Constructor Detail
-
ImageWarp
private ImageWarp()
-
-
Method Detail
-
warp
public static java.awt.image.BufferedImage warp(java.awt.image.BufferedImage srcImg, java.awt.Dimension targetDim, ImageWarp.PointTransform invTransform, ImageWarp.Interpolation interpolation)
Warp an image.- Parameters:
srcImg
- the original imagetargetDim
- dimension of the target imageinvTransform
- inverse transformation (translates pixel coordinates of the target image to pixel coordinates of the original image)interpolation
- the interpolation method- Returns:
- the warped image
-
getSharedArray
private static java.lang.Object getSharedArray(java.awt.image.BufferedImage srcImg)
-
getColor
private static int getColor(int x, int y, java.awt.image.BufferedImage img, java.lang.Object sharedArray)
-
-