org.esa.beam.util
Class ImageUtils

java.lang.Object
  extended by org.esa.beam.util.ImageUtils

public class ImageUtils
extends Object

A utility class providing a set of static functions frequently used when working with images.

All functions have been implemented with extreme caution in order to provide a maximum performance.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Constructor Summary
ImageUtils()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtils

public ImageUtils()
Method Detail

convertImage

public static BufferedImage convertImage(RenderedImage image,
                                         int imageType)
Converts the given rendered image into an image of the given {#link java.awt.image.BufferedImage} type.

Parameters:
image - the source image
imageType - the {#link java.awt.image.BufferedImage} type
Returns:
the buffered image of the given type

getDataTypeMinMax

public 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.

Parameters:
dataType - a data type as defined in DataBuffer
See Also:
DataBuffer

getDataTypeName

public static String getDataTypeName(int dataType)
Gets a textual representation of the supplied raster data type

Parameters:
dataType - a data type as defined in DataBuffer
Returns:
a textual representation of the supplied raster data type
See Also:
DataBuffer

getColorSpaceName

public static String getColorSpaceName(int spaceType)
Gets a textual representation of the supplied color space type

Parameters:
spaceType - a dcolor space type as defined in ColorSpace
Returns:
a textual representation of the color space
See Also:
ColorSpace

createGreyscaleColorModelImage

public static BufferedImage createGreyscaleColorModelImage(int width,
                                                           int height,
                                                           byte[] data)

createIndexedImage

public static BufferedImage createIndexedImage(int width,
                                               int height,
                                               byte[] data,
                                               IndexColorModel cm)

create8BitGreyscaleColorModel

public static ColorModel create8BitGreyscaleColorModel()

getPrimitiveArray

public static Object getPrimitiveArray(DataBuffer dataBuffer)

createDataBufferArray

public static Object createDataBufferArray(int dataBufferType,
                                           int size)

createSingleBandedSampleModel

public static SampleModel createSingleBandedSampleModel(int dataBufferType,
                                                        int width,
                                                        int height)

createRenderedImage

public static RenderedImage createRenderedImage(int width,
                                                int height,
                                                ProductData data)


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.