public class ImageUtils extends Object
All functions have been implemented with extreme caution in order to provide a maximum performance.
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static CrsGeoCoding |
buildCrsGeoCoding(double coordinateUpperLeftX,
double coordinateUpperLeftY,
double resolutionX,
double resolutionY,
Dimension defaultSize,
org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS,
Rectangle subsetBounds) |
static CrsGeoCoding |
buildCrsGeoCoding(double coordinateUpperLeftX,
double coordinateUpperLeftY,
double resolutionX,
double resolutionY,
int defaultWidth,
int defaultHeight,
org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS,
Rectangle subsetBounds) |
static CrsGeoCoding |
buildCrsGeoCoding(double coordinateUpperLeftX,
double coordinateUpperLeftY,
double resolutionX,
double resolutionY,
int defaultWidth,
int defaultHeight,
org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS,
Rectangle subsetBounds,
double referencePixelX,
double referencePixelY) |
static CrsGeoCoding |
buildCrsGeoCoding(Point2D.Double coordinateUpperLeft,
Point2D.Double resolution,
Dimension defaultSize,
org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS,
Rectangle subsetBounds) |
static javax.media.jai.ImageLayout |
buildImageLayout(Integer dataBufferType,
int imageWidth,
int imageHeight,
int level,
Dimension defaultJAIReadTileSize)
Creates a new image layout for the specified level.
|
static javax.media.jai.ImageLayout |
buildImageLayout(Integer dataBufferType,
int imageWidth,
int imageHeight,
int level,
Dimension defaultJAIReadTileSize,
int topLeftTileWidth,
int topLeftTileHeight)
Creates a new image layout for the specified level.
|
static javax.media.jai.ImageLayout |
buildTileImageLayout(int dataBufferType,
int imageWidth,
int imageHeight,
int level,
Dimension defaultJAIReadTileSize)
Creates the image layout of a tile image for the specified level.
|
static int |
computeLevelSize(int sourceSize,
int level) |
static double |
computeLevelSizeAsDouble(int sourceSize,
int level) |
static Dimension |
computeSceneRasterSize(int defaultSceneRasterWidth,
int defaultSceneRasterHeight,
Dimension regionRasterSize) |
static int |
computeTileCount(int imageSize,
int tileSize) |
static BufferedImage |
convertImage(RenderedImage image,
int imageType)
Converts the given rendered image into an image of the given {#link java.awt.image.BufferedImage} type.
|
static ColorModel |
create8BitGreyscaleColorModel() |
static Object |
createDataBufferArray(int dataBufferType,
int size) |
static BufferedImage |
createGreyscaleColorModelImage(int width,
int height,
byte[] data) |
static BufferedImage |
createIndexedImage(int width,
int height,
byte[] data,
IndexColorModel cm) |
static RenderedImage |
createRenderedImage(int width,
int height,
ProductData data) |
static SampleModel |
createSingleBandedSampleModel(int dataBufferType,
int width,
int height) |
static String |
getColorSpaceName(int spaceType)
Gets a textual representation of the supplied color space type
|
static double[] |
getDataTypeMinMax(int dataType,
double[] minmax)
Returns an array containing the minimum and maximum value of the native data type used to store pixel values in
the given image.
|
static String |
getDataTypeName(int dataType)
Gets a textual representation of the supplied raster data type
|
static Object |
getPrimitiveArray(DataBuffer dataBuffer) |
public static javax.media.jai.ImageLayout buildImageLayout(Integer dataBufferType, int imageWidth, int imageHeight, int level, Dimension defaultJAIReadTileSize)
dataBufferType
- the buffer type of the sample model or null if no the sample model to createimageWidth
- the width of the imageimageHeight
- the height of the imagelevel
- the level for which the image layout is createddefaultJAIReadTileSize
- the default JAI tile sizepublic static javax.media.jai.ImageLayout buildImageLayout(Integer dataBufferType, int imageWidth, int imageHeight, int level, Dimension defaultJAIReadTileSize, int topLeftTileWidth, int topLeftTileHeight)
dataBufferType
- the buffer type of the sample model or null if no the sample model to createimageWidth
- the width of the imageimageHeight
- the height of the imagelevel
- the level for which the image layout is createddefaultJAIReadTileSize
- the default JAI tile sizetopLeftTileWidth
- the tile width from the left top corner of the final imagetopLeftTileHeight
- the tile height from the left top corner of the final imagepublic static javax.media.jai.ImageLayout buildTileImageLayout(int dataBufferType, int imageWidth, int imageHeight, int level, Dimension defaultJAIReadTileSize)
dataBufferType
- the buffer type of the sample modelimageWidth
- the width of the imageimageHeight
- the height of the imagelevel
- the level for which the image layout is createddefaultJAIReadTileSize
- the default JAI tile sizepublic static CrsGeoCoding buildCrsGeoCoding(Point2D.Double coordinateUpperLeft, Point2D.Double resolution, Dimension defaultSize, org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle subsetBounds) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
org.opengis.referencing.FactoryException
org.opengis.referencing.operation.TransformException
public static CrsGeoCoding buildCrsGeoCoding(double coordinateUpperLeftX, double coordinateUpperLeftY, double resolutionX, double resolutionY, Dimension defaultSize, org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle subsetBounds) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
org.opengis.referencing.FactoryException
org.opengis.referencing.operation.TransformException
public static CrsGeoCoding buildCrsGeoCoding(double coordinateUpperLeftX, double coordinateUpperLeftY, double resolutionX, double resolutionY, int defaultWidth, int defaultHeight, org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle subsetBounds) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
org.opengis.referencing.FactoryException
org.opengis.referencing.operation.TransformException
public static CrsGeoCoding buildCrsGeoCoding(double coordinateUpperLeftX, double coordinateUpperLeftY, double resolutionX, double resolutionY, int defaultWidth, int defaultHeight, org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle subsetBounds, double referencePixelX, double referencePixelY) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
org.opengis.referencing.FactoryException
org.opengis.referencing.operation.TransformException
public static Dimension computeSceneRasterSize(int defaultSceneRasterWidth, int defaultSceneRasterHeight, Dimension regionRasterSize)
public static int computeTileCount(int imageSize, int tileSize)
public static double computeLevelSizeAsDouble(int sourceSize, int level)
public static int computeLevelSize(int sourceSize, int level)
public static BufferedImage convertImage(RenderedImage image, int imageType)
image
- the source imageimageType
- the {#link java.awt.image.BufferedImage} typepublic static double[] getDataTypeMinMax(int dataType, double[] minmax)
dataType
- a data type as defined in DataBuffer
DataBuffer
public static String getDataTypeName(int dataType)
dataType
- a data type as defined in DataBuffer
DataBuffer
public static String getColorSpaceName(int spaceType)
spaceType
- a dcolor space type as defined in ColorSpace
ColorSpace
public static BufferedImage createGreyscaleColorModelImage(int width, int height, byte[] data)
public static BufferedImage createIndexedImage(int width, int height, byte[] data, IndexColorModel cm)
public static ColorModel create8BitGreyscaleColorModel()
public static Object getPrimitiveArray(DataBuffer dataBuffer)
public static Object createDataBufferArray(int dataBufferType, int size)
public static SampleModel createSingleBandedSampleModel(int dataBufferType, int width, int height)
public static RenderedImage createRenderedImage(int width, int height, ProductData data)
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.