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 BufferedImageclipToRectangleWithGraphicsDraw(BufferedImage srcImage, Rectangle clipRect, Color clipBackgroundColor) static final BufferedImageconvertToMostFavorableImageType(BufferedImage srcImage) static final BufferedImagestatic final BufferedImagestatic final BufferedImagestatic final BufferedImagestatic final BufferedImagestatic byte[]convertYBRToRGB(byte srcY, byte srcCb, byte srcCr, byte[] dst) static final BufferedImageconvertYBRToRGB(BufferedImage srcImage) static final BufferedImagestatic StringdescribeColorModel(ColorModel model) Describe characteristics of ColorModel.static voiddescribeColorModel(ColorModel model, PrintStream out) Describe characteristics of ColorModel.static StringdescribeImage(BufferedImage image) Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.static voiddescribeImage(BufferedImage image, PrintStream out) Describe characteristics of BufferedImage's Raster, SampleModel, ColorModel, etc.static StringdescribeRaster(Raster raster) Describe characteristics of Raster.static voiddescribeRaster(Raster raster, PrintStream out) Describe characteristics of Raster.static voidflipHorizontally(BufferedImage srcImage) static voidflipVertically(BufferedImage srcImage) static GraphicsConfigurationstatic ColorModelfinal BufferedImageresample(BufferedImage srcImage, int dstWidth, int dstHeight, boolean signed, int backgroundValue) final BufferedImageresample(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight, boolean signed, int backgroundValue) static final BufferedImageresampleWithAffineTransformOp(BufferedImage srcImage, double sx, double sy) static final BufferedImageresampleWithAffineTransformOp(BufferedImage srcImage, int dstWidth, int dstHeight) final BufferedImageresampleWithGraphicsDraw(BufferedImage srcImage, int selectionWidth, int selectionHeight, int selectionXOffset, int selectionYOffset, int dstWidth, int dstHeight) static BufferedImagestatic StringtransferTypeName(int bufferType) static StringtypeName(int imageType) Return name for given BufferedImage type.static StringtypeName(int imageType, BufferedImage image) Return name for integer type and/or for BufferedImage's actual type.static StringtypeName(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-
-