public class ImageData extends Object implements Serializable
Image
or as a
byte[]
array containing RGBA values
for each pixel (row/column order ?).
If bytes or Image is available use a Constructor -
otherwise use a factory method to load an image
from an Input
source
Note: this class is immutable. The Constructors that have an image parameter just extract the data from the given image and don't reference it any longer. byte[] data is copied. Pending: do we want to keep the original image to pass out as RO instance?
Constructor and Description |
---|
ImageData(byte[] data,
int width,
int height) |
ImageData(Image img) |
ImageData(Image img,
double[] channelMatrix) |
ImageData(Image img,
int width,
int height) |
ImageData(Image img,
int width,
int height,
double[] channelMatrix) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteArray() |
byte[] |
getByteArray(double[] channelArithmeticMatrix)
applies the given matrix to all pixel values.
|
int |
getHeight() |
Image |
getImage() |
Image |
getOriginalImage() |
int |
getWidth() |
static ImageData |
load(Input input) |
static ImageData |
load(Input input,
double[] channelMatrix) |
String |
toString() |
public ImageData(byte[] data, int width, int height)
public ImageData(Image img)
public ImageData(Image img, int width, int height)
public ImageData(Image img, double[] channelMatrix)
public ImageData(Image img, int width, int height, double[] channelMatrix)
public static ImageData load(Input input) throws IOException
IOException
public static ImageData load(Input input, double[] channelMatrix) throws IOException
IOException
public int getHeight()
public int getWidth()
public Image getImage()
public byte[] getByteArray()
public Image getOriginalImage()
public byte[] getByteArray(double[] channelArithmeticMatrix)
channelArithmeticMatrix
- the matrix to multiply the byte array with