public class BufferedImageUtilities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[] |
bufferTypeNames
Indexes correspond to DataBuffer.TYPE_xxx values, except TYPE_UNDEFINED.
|
protected static java.lang.String[] |
imageTypeNames |
protected static java.lang.String[] |
spaceTypeNames
Indexes correspond to some ColorSpace.TYPE_xxx values.
|
Constructor and Description |
---|
BufferedImageUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
clipToRectangleWithGraphicsDraw(java.awt.image.BufferedImage srcImage,
java.awt.Rectangle clipRect,
java.awt.Color clipBackgroundColor) |
static java.awt.image.BufferedImage |
convertToMostFavorableImageType(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertToMostFavorableImageTypeWithBandCombineOp(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertToMostFavorableImageTypeWithDataBufferCopy(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertToMostFavorableImageTypeWithGraphicsDraw(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertToMostFavorableImageTypeWithPixelCopy(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertToThreeChannelImageTypeIfFour(java.awt.image.BufferedImage srcImage) |
static java.awt.image.BufferedImage |
convertYBRToRGB(java.awt.image.BufferedImage srcImage) |
static byte[] |
convertYBRToRGB(byte srcY,
byte srcCb,
byte srcCr,
byte[] dst) |
static java.awt.image.BufferedImage |
createEmptyBufferedImageOfSameTypeAndSize(java.awt.image.BufferedImage srcImage) |
static java.lang.String |
describeColorModel(java.awt.image.ColorModel model)
Describe characteristics of ColorModel.
|
static void |
describeColorModel(java.awt.image.ColorModel model,
java.io.PrintStream out)
Describe characteristics of ColorModel.
|
static java.lang.String |
describeImage(java.awt.image.BufferedImage image)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
|
static void |
describeImage(java.awt.image.BufferedImage image,
java.io.PrintStream out)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
|
static java.lang.String |
describeRaster(java.awt.image.Raster raster)
Describe characteristics of Raster.
|
static void |
describeRaster(java.awt.image.Raster raster,
java.io.PrintStream out)
Describe characteristics of Raster.
|
static void |
flipHorizontally(java.awt.image.BufferedImage srcImage) |
static void |
flipVertically(java.awt.image.BufferedImage srcImage) |
static java.awt.GraphicsConfiguration |
getDefaultGraphicsConfiguration() |
static java.awt.image.ColorModel |
getMostFavorableColorModel() |
java.awt.image.BufferedImage |
resample(java.awt.image.BufferedImage srcImage,
int dstWidth,
int dstHeight,
boolean signed,
int backgroundValue) |
java.awt.image.BufferedImage |
resample(java.awt.image.BufferedImage srcImage,
int selectionWidth,
int selectionHeight,
int selectionXOffset,
int selectionYOffset,
int dstWidth,
int dstHeight,
boolean signed,
int backgroundValue) |
static java.awt.image.BufferedImage |
resampleWithAffineTransformOp(java.awt.image.BufferedImage srcImage,
double sx,
double sy) |
static java.awt.image.BufferedImage |
resampleWithAffineTransformOp(java.awt.image.BufferedImage srcImage,
int dstWidth,
int dstHeight) |
java.awt.image.BufferedImage |
resampleWithGraphicsDraw(java.awt.image.BufferedImage srcImage,
int selectionWidth,
int selectionHeight,
int selectionXOffset,
int selectionYOffset,
int dstWidth,
int dstHeight) |
static java.awt.image.BufferedImage |
rotateAndFlipSwappingRowsAndColumns(java.awt.image.BufferedImage srcImage) |
static java.lang.String |
transferTypeName(int bufferType) |
static java.lang.String |
typeName(java.awt.color.ColorSpace space)
Return name for its color-space type.
|
static java.lang.String |
typeName(int imageType)
Return name for given BufferedImage type.
|
static java.lang.String |
typeName(int imageType,
java.awt.image.BufferedImage image)
Return name for integer type and/or for BufferedImage's actual type.
|
protected static final java.lang.String[] bufferTypeNames
protected static final java.lang.String[] imageTypeNames
protected static final java.lang.String[] spaceTypeNames
public static final java.awt.image.BufferedImage clipToRectangleWithGraphicsDraw(java.awt.image.BufferedImage srcImage, java.awt.Rectangle clipRect, java.awt.Color clipBackgroundColor)
srcImage
- clipRect
- clipBackgroundColor
- public static final java.awt.image.BufferedImage convertToMostFavorableImageType(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertToMostFavorableImageTypeWithBandCombineOp(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertToMostFavorableImageTypeWithDataBufferCopy(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertToMostFavorableImageTypeWithGraphicsDraw(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertToMostFavorableImageTypeWithPixelCopy(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertToThreeChannelImageTypeIfFour(java.awt.image.BufferedImage srcImage)
srcImage
- public static final java.awt.image.BufferedImage convertYBRToRGB(java.awt.image.BufferedImage srcImage)
srcImage
- a BufferedImage pretending to be an RGB ColorModel but really YBRpublic static byte[] convertYBRToRGB(byte srcY, byte srcCb, byte srcCr, byte[] dst)
srcY
- YBR Y valuesrcCb
- YBR Cb valuesrcCr
- YBR Cr valuedst
- an array of length three in which to return the RGB values, in that orderpublic static final java.awt.image.BufferedImage createEmptyBufferedImageOfSameTypeAndSize(java.awt.image.BufferedImage srcImage)
srcImage
- public static java.lang.String describeColorModel(java.awt.image.ColorModel model)
Describe characteristics of ColorModel.
model
- return descriptionpublic static void describeColorModel(java.awt.image.ColorModel model, java.io.PrintStream out)
Describe characteristics of ColorModel.
model
- out
- public static java.lang.String describeImage(java.awt.image.BufferedImage image)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
image
- return descriptionpublic static void describeImage(java.awt.image.BufferedImage image, java.io.PrintStream out)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
image
- out
- public static java.lang.String describeRaster(java.awt.image.Raster raster)
Describe characteristics of Raster.
raster
- return descriptionpublic static void describeRaster(java.awt.image.Raster raster, java.io.PrintStream out)
Describe characteristics of Raster.
raster
- out
- public static void flipHorizontally(java.awt.image.BufferedImage srcImage)
public static void flipVertically(java.awt.image.BufferedImage srcImage)
public static java.awt.GraphicsConfiguration getDefaultGraphicsConfiguration()
public static java.awt.image.ColorModel getMostFavorableColorModel()
public final java.awt.image.BufferedImage resample(java.awt.image.BufferedImage srcImage, int dstWidth, int dstHeight, boolean signed, int backgroundValue)
public final java.awt.image.BufferedImage resample(java.awt.image.BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight, boolean signed, int backgroundValue)
public static final java.awt.image.BufferedImage resampleWithAffineTransformOp(java.awt.image.BufferedImage srcImage, double sx, double sy)
public static final java.awt.image.BufferedImage resampleWithAffineTransformOp(java.awt.image.BufferedImage srcImage, int dstWidth, int dstHeight)
public final java.awt.image.BufferedImage resampleWithGraphicsDraw(java.awt.image.BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight)
public static java.awt.image.BufferedImage rotateAndFlipSwappingRowsAndColumns(java.awt.image.BufferedImage srcImage)
public static java.lang.String transferTypeName(int bufferType)
public static java.lang.String typeName(java.awt.color.ColorSpace space)
Return name for its color-space type.
space
- public static java.lang.String typeName(int imageType)
public static java.lang.String typeName(int imageType, java.awt.image.BufferedImage image)
Return name for integer type and/or for BufferedImage's actual type.
If image is null, then name is for imageType alone.
If image is non-null, and its type matches imageType, then name is for imageType alone.
If image's type doesn't match imageType, then name is first for imageType, followed by image's actual type name in parentheses.
imageType
- image
-