Modifier and Type | Field and Description |
---|---|
protected static Map<String,int[]> |
colormaps
A mapping of color names to interpolating colormaps.
|
Modifier and Type | Method and Description |
---|---|
static BufferedImage |
bytesToJpeg(byte[] data)
Converts a
byte array to a BufferedImage . |
static BufferedImage |
createImage(RealArray m,
String cmName,
double rangeMin,
double rangeMax)
Converts a
RealArray to a BufferedImage . |
protected static int[] |
createInterpolatingColormap(int... args)
Creates a colormap by interpolating between start, end, and intermediate colors.
|
static RealArray |
createMatrix(BufferedImage image)
Converts a
BufferedImage to a RealArray . |
static RealArray |
createMatrix(byte[] data)
Creates a
RealArray from a byte array. |
static RealArray |
createMatrix(File file)
Creates a
RealArray from an image file. |
protected static BufferedImage |
ensureGrayscale(BufferedImage src)
Ensures that an image is in grayscale, converting it if necessary.
|
static byte[] |
jpegToBytes(BufferedImage bi)
Converts a
BufferedImage to a byte array. |
public static final BufferedImage createImage(RealArray m, String cmName, double rangeMin, double rangeMax)
RealArray
to a BufferedImage
.m
- the intensity image.cmName
- the name of the colormap to display with.rangeMin
- the minimum intensity.rangeMax
- the maximum intensity.public static final RealArray createMatrix(BufferedImage image)
BufferedImage
to a RealArray
.image
- the original image.public static final RealArray createMatrix(File file) throws IOException
RealArray
from an image file.file
- the image file.IOException
- when the load operation goes awry.public static final RealArray createMatrix(byte[] data) throws IOException
RealArray
from a byte
array.data
- the binary data.IOException
- when the load operation goes awry.public static final byte[] jpegToBytes(BufferedImage bi) throws IOException
BufferedImage
to a byte
array.bi
- the image.IOException
- when the encoding operation goes awry.public static final BufferedImage bytesToJpeg(byte[] data) throws IOException
byte
array to a BufferedImage
.data
- the binary data.IOException
- when the decoding operation goes awry.protected static final BufferedImage ensureGrayscale(BufferedImage src)
protected static final int[] createInterpolatingColormap(int... args)