Class ImageUtils
- java.lang.Object
-
- net.anwiba.commons.image.experimental.ImageUtils
-
public class ImageUtils extends java.lang.ObjectA 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
Constructors Constructor Description ImageUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.image.BufferedImageconvertImage(java.awt.image.RenderedImage image, int imageType)Converts the given rendered image into an image of the given {#link java.awt.image.BufferedImage} type.static java.awt.image.ColorModelcreate8BitGreyscaleColorModel()static java.lang.ObjectcreateDataBufferArray(int dataBufferType, int size)static java.awt.image.BufferedImagecreateGreyscaleColorModelImage(int width, int height, byte[] data)static java.awt.image.BufferedImagecreateIndexedImage(int width, int height, byte[] data, java.awt.image.IndexColorModel cm)static java.awt.image.SampleModelcreateSingleBandedSampleModel(int dataBufferType, int width, int height)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 java.lang.ObjectgetPrimitiveArray(java.awt.image.DataBuffer dataBuffer)
-
-
-
Method Detail
-
convertImage
public static java.awt.image.BufferedImage convertImage(java.awt.image.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 imageimageType- 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 inDataBuffer- See Also:
DataBuffer
-
createGreyscaleColorModelImage
public static java.awt.image.BufferedImage createGreyscaleColorModelImage(int width, int height, byte[] data)
-
createIndexedImage
public static java.awt.image.BufferedImage createIndexedImage(int width, int height, byte[] data, java.awt.image.IndexColorModel cm)
-
create8BitGreyscaleColorModel
public static java.awt.image.ColorModel create8BitGreyscaleColorModel()
-
getPrimitiveArray
public static java.lang.Object getPrimitiveArray(java.awt.image.DataBuffer dataBuffer)
-
createDataBufferArray
public static java.lang.Object createDataBufferArray(int dataBufferType, int size)
-
createSingleBandedSampleModel
public static java.awt.image.SampleModel createSingleBandedSampleModel(int dataBufferType, int width, int height)
-
-