public class BufferedImageUtilities extends Object
Modifier and Type | Field and Description |
---|---|
protected static String[] |
bufferTypeNames
Indexes correspond to DataBuffer.TYPE_xxx values, except TYPE_UNDEFINED.
|
protected static String[] |
imageTypeNames |
protected static String[] |
spaceTypeNames
Indexes correspond to some ColorSpace.TYPE_xxx values.
|
Constructor and Description |
---|
BufferedImageUtilities() |
Modifier and Type | Method and Description |
---|---|
static BufferedImage |
clipToRectangleWithGraphicsDraw(BufferedImage srcImage,
Rectangle clipRect,
Color clipBackgroundColor) |
static BufferedImage |
convertToMostFavorableImageType(BufferedImage srcImage) |
static BufferedImage |
convertToMostFavorableImageTypeWithBandCombineOp(BufferedImage srcImage) |
static BufferedImage |
convertToMostFavorableImageTypeWithDataBufferCopy(BufferedImage srcImage) |
static BufferedImage |
convertToMostFavorableImageTypeWithGraphicsDraw(BufferedImage srcImage) |
static BufferedImage |
convertToMostFavorableImageTypeWithPixelCopy(BufferedImage srcImage) |
static BufferedImage |
convertToThreeChannelImageTypeIfFour(BufferedImage srcImage) |
static BufferedImage |
convertYBRToRGB(BufferedImage srcImage) |
static byte[] |
convertYBRToRGB(byte srcY,
byte srcCb,
byte srcCr,
byte[] dst) |
static BufferedImage |
createEmptyBufferedImageOfSameTypeAndSize(BufferedImage srcImage) |
static String |
describeColorModel(ColorModel model)
Describe characteristics of ColorModel.
|
static void |
describeColorModel(ColorModel model,
PrintStream out)
Describe characteristics of ColorModel.
|
static String |
describeImage(BufferedImage image)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
|
static void |
describeImage(BufferedImage image,
PrintStream out)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
|
static String |
describeRaster(Raster raster)
Describe characteristics of Raster.
|
static void |
describeRaster(Raster raster,
PrintStream out)
Describe characteristics of Raster.
|
static void |
flipHorizontally(BufferedImage srcImage) |
static void |
flipVertically(BufferedImage srcImage) |
static GraphicsConfiguration |
getDefaultGraphicsConfiguration() |
static ColorModel |
getMostFavorableColorModel() |
BufferedImage |
resample(BufferedImage srcImage,
int dstWidth,
int dstHeight,
boolean signed,
int backgroundValue) |
BufferedImage |
resample(BufferedImage srcImage,
int selectionWidth,
int selectionHeight,
int selectionXOffset,
int selectionYOffset,
int dstWidth,
int dstHeight,
boolean signed,
int backgroundValue) |
static BufferedImage |
resampleWithAffineTransformOp(BufferedImage srcImage,
double sx,
double sy) |
static BufferedImage |
resampleWithAffineTransformOp(BufferedImage srcImage,
int dstWidth,
int dstHeight) |
BufferedImage |
resampleWithGraphicsDraw(BufferedImage srcImage,
int selectionWidth,
int selectionHeight,
int selectionXOffset,
int selectionYOffset,
int dstWidth,
int dstHeight) |
static BufferedImage |
rotateAndFlipSwappingRowsAndColumns(BufferedImage srcImage) |
static String |
transferTypeName(int bufferType) |
static String |
typeName(ColorSpace space)
Return name for its color-space type.
|
static String |
typeName(int imageType)
Return name for given BufferedImage type.
|
static String |
typeName(int imageType,
BufferedImage image)
Return name for integer type and/or for BufferedImage's actual type.
|
protected static final String[] bufferTypeNames
protected static final String[] imageTypeNames
protected static final String[] spaceTypeNames
public static final BufferedImage clipToRectangleWithGraphicsDraw(BufferedImage srcImage, Rectangle clipRect, Color clipBackgroundColor)
srcImage
- clipRect
- clipBackgroundColor
- public static final BufferedImage convertToMostFavorableImageType(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertToMostFavorableImageTypeWithBandCombineOp(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertToMostFavorableImageTypeWithDataBufferCopy(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertToMostFavorableImageTypeWithGraphicsDraw(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertToMostFavorableImageTypeWithPixelCopy(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertToThreeChannelImageTypeIfFour(BufferedImage srcImage)
srcImage
- public static final BufferedImage convertYBRToRGB(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 BufferedImage createEmptyBufferedImageOfSameTypeAndSize(BufferedImage srcImage)
srcImage
- public static String describeColorModel(ColorModel model)
Describe characteristics of ColorModel.
model
- return descriptionpublic static void describeColorModel(ColorModel model, PrintStream out)
Describe characteristics of ColorModel.
model
- out
- public static String describeImage(BufferedImage image)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
image
- return descriptionpublic static void describeImage(BufferedImage image, PrintStream out)
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
image
- out
- public static String describeRaster(Raster raster)
Describe characteristics of Raster.
raster
- return descriptionpublic static void describeRaster(Raster raster, PrintStream out)
Describe characteristics of Raster.
raster
- out
- public static void flipHorizontally(BufferedImage srcImage)
public static void flipVertically(BufferedImage srcImage)
public static GraphicsConfiguration getDefaultGraphicsConfiguration()
public static ColorModel getMostFavorableColorModel()
public final BufferedImage resample(BufferedImage srcImage, int dstWidth, int dstHeight, boolean signed, int backgroundValue)
public final BufferedImage resample(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight, boolean signed, int backgroundValue)
public static final BufferedImage resampleWithAffineTransformOp(BufferedImage srcImage, double sx, double sy)
public static final BufferedImage resampleWithAffineTransformOp(BufferedImage srcImage, int dstWidth, int dstHeight)
public final BufferedImage resampleWithGraphicsDraw(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight)
public static BufferedImage rotateAndFlipSwappingRowsAndColumns(BufferedImage srcImage)
public static String transferTypeName(int bufferType)
public static String typeName(ColorSpace space)
Return name for its color-space type.
space
- public static String typeName(int imageType)
public static String typeName(int imageType, 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
-