public class ConvertBufferedImage extends Object
BufferedImage.| Constructor and Description |
|---|
ConvertBufferedImage() |
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
checkInputs(ImageBase src,
BufferedImage dst)
If null the dst is declared, otherwise it checks to see if the 'dst' as the same shape as 'src'.
|
static ImageFloat32 |
convertFrom(BufferedImage src,
ImageFloat32 dst)
Converts the buffered image into an
ImageFloat32. |
static ImageUInt8 |
convertFrom(BufferedImage src,
ImageUInt8 dst)
Converts the buffered image into an
ImageUInt8. |
static <T extends ImageBase> |
convertFrom(BufferedImage src,
T dst,
boolean orderRgb)
Converts a buffered image into an image of the specified type.
|
static <T extends ImageInt16> |
convertFrom(BufferedImage src,
T dst,
Class<T> type)
Converts the buffered image into an
ImageInt16. |
static <T extends ImageSingleBand> |
convertFromMulti(BufferedImage src,
MultiSpectral<T> dst,
boolean orderRgb,
Class<T> type)
Converts the buffered image into an
MultiSpectral image of the specified
type. |
static <T extends ImageSingleBand> |
convertFromSingle(BufferedImage src,
T dst,
Class<T> type)
Converts a buffered image into an image of the specified type.
|
static BufferedImage |
convertTo_F32(MultiSpectral<ImageFloat32> src,
BufferedImage dst,
boolean orderRgb)
Converts a
ImageUInt8 into a BufferedImage. |
static BufferedImage |
convertTo_U8(MultiSpectral<ImageUInt8> src,
BufferedImage dst,
boolean orderRgb)
Converts a
ImageUInt8 into a BufferedImage. |
static BufferedImage |
convertTo(ImageBase src,
BufferedImage dst,
boolean orderRgb)
Converts an image into a BufferedImage.
|
static BufferedImage |
convertTo(ImageFloat32 src,
BufferedImage dst)
Converts the buffered image into an
ImageFloat32. |
static BufferedImage |
convertTo(ImageInt16 src,
BufferedImage dst)
Converts a
ImageInt16 into a BufferedImage. |
static BufferedImage |
convertTo(ImageUInt8 src,
BufferedImage dst)
Converts a
ImageUInt8 into a BufferedImage. |
static BufferedImage |
convertTo(JComponent comp,
BufferedImage storage)
Draws the component into a BufferedImage.
|
static BufferedImage |
extractBuffered(ImageUInt8 img)
Creates a new BufferedImage that internally uses the same data as the provided
ImageUInt8.
|
static BufferedImage |
extractBuffered(InterleavedU8 img)
Creates a new BufferedImage that internally uses the same data as the provided
InterleavedU8. |
static ImageUInt8 |
extractImageUInt8(BufferedImage img)
For BufferedImage stored as a byte array internally it extracts an
image.
|
static InterleavedU8 |
extractInterleavedU8(BufferedImage img)
For BufferedImage stored as a byte array internally it extracts an
interleaved image.
|
static boolean |
isSubImage(BufferedImage img)
Checks to see if the input image is a subImage().
|
static MultiSpectral |
orderBandsIntoBuffered(MultiSpectral src,
BufferedImage dst)
Returns a new image with the color bands in the appropriate ordering.
|
static <T extends ImageSingleBand> |
orderBandsIntoRGB(MultiSpectral<T> image,
BufferedImage input)
If a MultiSpectral was created from a BufferedImage its colors might not be in the expected order.
|
public static InterleavedU8 extractInterleavedU8(BufferedImage img)
img - Image whose internal data is extracted and wrapped.public static ImageUInt8 extractImageUInt8(BufferedImage img)
img - Image whose internal data is extracted and wrapped.public static BufferedImage extractBuffered(InterleavedU8 img)
InterleavedU8. If 3 bands then the image will be of type TYPE_3BYTE_BGR
or if 1 band TYPE_BYTE_GRAY.img - Input image who's data will be wrapped by the returned BufferedImage.public static BufferedImage extractBuffered(ImageUInt8 img)
Creates a new BufferedImage that internally uses the same data as the provided ImageUInt8. The returned BufferedImage will be of type TYPE_BYTE_GRAY.
NOTE: This only works on images which are not subimages!
img - Input image who's data will be wrapped by the returned BufferedImage.public static <T extends ImageBase> void convertFrom(BufferedImage src, T dst, boolean orderRgb)
src - Input BufferedImage which is to be converteddst - The image which it is being converted intoorderRgb - If applicable, should it adjust the ordering of each color band to maintain color consistencypublic static <T extends ImageSingleBand> T convertFromSingle(BufferedImage src, T dst, Class<T> type)
public static ImageUInt8 convertFrom(BufferedImage src, ImageUInt8 dst)
ImageUInt8. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new unsigned image is created.public static <T extends ImageInt16> T convertFrom(BufferedImage src, T dst, Class<T> type)
ImageInt16. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new unsigned image is created.public static ImageFloat32 convertFrom(BufferedImage src, ImageFloat32 dst)
ImageFloat32. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new unsigned image is created.public static <T extends ImageSingleBand> MultiSpectral<T> convertFromMulti(BufferedImage src, MultiSpectral<T> dst, boolean orderRgb, Class<T> type)
MultiSpectral image of the specified
type.src - Input image. Not modified.dst - Output. The converted image is written to. If null a new unsigned image is created.orderRgb - If applicable, should it adjust the ordering of each color band to maintain color consistency.
Most of the time you want this to be true.type - Which type of data structure is each band. (ImageUInt8 or ImageFloat32)public static BufferedImage convertTo(ImageBase src, BufferedImage dst, boolean orderRgb)
src - Input image. Pixels must have a value from 0 to 255.dst - Where the converted image is written to. If null a new image is created.orderRgb - If applicable, should it change the order of the color bands (assumed RGB or ARGB) into the
order based on BufferedImage.TYPE. Most of the time you want this to be true.public static BufferedImage convertTo(ImageUInt8 src, BufferedImage dst)
ImageUInt8 into a BufferedImage. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new image is created.public static BufferedImage convertTo(ImageInt16 src, BufferedImage dst)
ImageInt16 into a BufferedImage. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new image is created.public static BufferedImage convertTo(ImageFloat32 src, BufferedImage dst)
ImageFloat32. If the buffered image
has multiple channels the intensities of each channel are averaged together. The floating
point image is assumed to be between 0 and 255.src - Input image.dst - Where the converted image is written to. If null a new image is created.public static BufferedImage convertTo_U8(MultiSpectral<ImageUInt8> src, BufferedImage dst, boolean orderRgb)
ImageUInt8 into a BufferedImage. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new image is created.orderRgb - If applicable, should it change the order of the color bands (assumed RGB or ARGB) into the
order based on BufferedImage.TYPE. Most of the time you want this to be true.public static BufferedImage convertTo_F32(MultiSpectral<ImageFloat32> src, BufferedImage dst, boolean orderRgb)
ImageUInt8 into a BufferedImage. If the buffered image
has multiple channels the intensities of each channel are averaged together.src - Input image.dst - Where the converted image is written to. If null a new image is created.orderRgb - If applicable, should it change the order of the color bands (assumed RGB or ARGB) into the
order based on BufferedImage.TYPE. Most of the time you want this to be true.public static BufferedImage checkInputs(ImageBase src, BufferedImage dst)
public static BufferedImage convertTo(JComponent comp, BufferedImage storage)
comp - The component being drawn into an image.storage - if not null the component is drawn into it, if null a new BufferedImage is created.public static MultiSpectral orderBandsIntoBuffered(MultiSpectral src, BufferedImage dst)
public static <T extends ImageSingleBand> void orderBandsIntoRGB(MultiSpectral<T> image, BufferedImage input)
public static boolean isSubImage(BufferedImage img)
img - Copyright © 2013. All Rights Reserved.