Package com.pixelmed.display
Class BufferedImageUtilities
java.lang.Object
com.pixelmed.display.BufferedImageUtilities
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final BufferedImage
clipToRectangleWithGraphicsDraw
(BufferedImage srcImage, Rectangle clipRect, Color clipBackgroundColor) static final BufferedImage
convertToMostFavorableImageType
(BufferedImage srcImage) static final BufferedImage
static final BufferedImage
static final BufferedImage
static final BufferedImage
static final BufferedImage
static byte[]
convertYBRToRGB
(byte srcY, byte srcCb, byte srcCr, byte[] dst) static final BufferedImage
convertYBRToRGB
(BufferedImage srcImage) static final BufferedImage
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
static ColorModel
final BufferedImage
resample
(BufferedImage srcImage, int dstWidth, int dstHeight, boolean signed, int backgroundValue) final BufferedImage
resample
(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight, boolean signed, int backgroundValue) static final BufferedImage
resampleWithAffineTransformOp
(BufferedImage srcImage, double sx, double sy) static final BufferedImage
resampleWithAffineTransformOp
(BufferedImage srcImage, int dstWidth, int dstHeight) final BufferedImage
resampleWithGraphicsDraw
(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight) static BufferedImage
static String
transferTypeName
(int bufferType) 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.static String
typeName
(ColorSpace space) Return name for its color-space type.
-
Field Details
-
imageTypeNames
-
bufferTypeNames
Indexes correspond to DataBuffer.TYPE_xxx values, except TYPE_UNDEFINED. -
spaceTypeNames
Indexes correspond to some ColorSpace.TYPE_xxx values.
-
-
Constructor Details
-
BufferedImageUtilities
public BufferedImageUtilities()
-
-
Method Details
-
typeName
Return name for given BufferedImage type. -
typeName
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.
- Parameters:
imageType
-image
-- Returns:
- String name
-
transferTypeName
-
typeName
Return name for its color-space type.
- Parameters:
space
-- Returns:
- String name
-
describeImage
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
- Parameters:
image
-out
-
-
describeImage
Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.
- Parameters:
image
- return description
-
describeRaster
Describe characteristics of Raster.
- Parameters:
raster
-out
-
-
describeRaster
Describe characteristics of Raster.
- Parameters:
raster
- return description
-
describeColorModel
Describe characteristics of ColorModel.
- Parameters:
model
-out
-
-
describeColorModel
Describe characteristics of ColorModel.
- Parameters:
model
- return description
-
getDefaultGraphicsConfiguration
- Returns:
- the GraphicsConfiguration that is likely to perform most efficiently on this host
-
getMostFavorableColorModel
- Returns:
- the ColorModel that is likely to perform most efficiently on this host
-
convertToMostFavorableImageTypeWithPixelCopy
public static final BufferedImage convertToMostFavorableImageTypeWithPixelCopy(BufferedImage srcImage) - Parameters:
srcImage
-
-
convertToMostFavorableImageTypeWithDataBufferCopy
public static final BufferedImage convertToMostFavorableImageTypeWithDataBufferCopy(BufferedImage srcImage) - Parameters:
srcImage
-
-
convertToMostFavorableImageTypeWithBandCombineOp
public static final BufferedImage convertToMostFavorableImageTypeWithBandCombineOp(BufferedImage srcImage) - Parameters:
srcImage
-
-
convertToMostFavorableImageTypeWithGraphicsDraw
public static final BufferedImage convertToMostFavorableImageTypeWithGraphicsDraw(BufferedImage srcImage) - Parameters:
srcImage
-
-
convertToMostFavorableImageType
- Parameters:
srcImage
-
-
convertToThreeChannelImageTypeIfFour
- Parameters:
srcImage
-
-
resample
public final BufferedImage resample(BufferedImage srcImage, int dstWidth, int dstHeight, boolean signed, int backgroundValue) -
resample
public final BufferedImage resample(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight, boolean signed, int backgroundValue) -
resampleWithGraphicsDraw
public final BufferedImage resampleWithGraphicsDraw(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight) -
resampleWithAffineTransformOp
public static final BufferedImage resampleWithAffineTransformOp(BufferedImage srcImage, double sx, double sy) -
resampleWithAffineTransformOp
public static final BufferedImage resampleWithAffineTransformOp(BufferedImage srcImage, int dstWidth, int dstHeight) -
flipHorizontally
-
flipVertically
-
rotateAndFlipSwappingRowsAndColumns
-
convertYBRToRGB
public static byte[] convertYBRToRGB(byte srcY, byte srcCb, byte srcCr, byte[] dst) - Parameters:
srcY
- YBR Y valuesrcCb
- YBR Cb valuesrcCr
- YBR Cr valuedst
- an array of length three in which to return the RGB values, in that order- Returns:
- the supplied destination array
-
convertYBRToRGB
- Parameters:
srcImage
- a BufferedImage pretending to be an RGB ColorModel but really YBR- Returns:
- a BufferedImage with pixel values that really are RGB
-
createEmptyBufferedImageOfSameTypeAndSize
- Parameters:
srcImage
-
-
clipToRectangleWithGraphicsDraw
public static final BufferedImage clipToRectangleWithGraphicsDraw(BufferedImage srcImage, Rectangle clipRect, Color clipBackgroundColor) - Parameters:
srcImage
-clipRect
-clipBackgroundColor
-
-