Package de.pco.common
Class AbstractImageData
java.lang.Object
de.pco.common.AbstractImageData
public abstract class AbstractImageData extends Object
Class represents the image and its metadata.
- Author:
- PCO
-
Field Summary
Fields Modifier and Type Field Description protected AbstractUnsignedArrayimageprotected ImageMetadatametadata -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractImageData(int[] image, int width, int height, ImageMetadata metadata)Stub of the constructor from a recounted array of values.protectedAbstractImageData(AbstractUnsignedArray image, int width, int height)Constructor from the wrapped array of values, without the metadata.protectedAbstractImageData(AbstractUnsignedArray image, int width, int height, ImageMetadata metadata)Constructor from the wrapped array of values and from the metadata. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)int[]getData()Returns the data of the image as int[].abstract intgetDataElementMaxValue()Returns the maximal value that can be stored in the returned data array.intgetHeight()Returns height of the image.InputStreamgetInputStream()Gets an InputStream of the backing array.ImageMetadatagetMetadata()Returns the image metadata.intgetWidth()Returns width of the image.inthashCode()abstract booleanisCompressed()Returns whether the data values of the image are of byte[].abstract voidsetData(int[] data)Sets the image data.StringtoString()
-
Field Details
-
image
-
metadata
-
-
Constructor Details
-
AbstractImageData
Constructor from the wrapped array of values, without the metadata.- Parameters:
image-width-height-
-
AbstractImageData
protected AbstractImageData(AbstractUnsignedArray image, int width, int height, ImageMetadata metadata)Constructor from the wrapped array of values and from the metadata.- Parameters:
image-width-height-metadata-
-
AbstractImageData
Stub of the constructor from a recounted array of values. Subclasses are expected to extend this constructor to set the member field of the image values by performing a check of the array values to fit for the particular backing data type (unsigned short[], unsigned byte[])- Parameters:
image-width-height-metadata-
-
-
Method Details
-
isCompressed
public abstract boolean isCompressed()Returns whether the data values of the image are of byte[].- Returns:
-
getData
public int[] getData()Returns the data of the image as int[]. The values are of one of int's subtype, bounded bygetDataElementMaxValue().- Returns:
-
getDataElementMaxValue
public abstract int getDataElementMaxValue()Returns the maximal value that can be stored in the returned data array.- Returns:
-
setData
public abstract void setData(int[] data)Sets the image data. Subclasses check the parameter whether it fits for the particular subtype (unsigned byte[], unsigned short[]).- Parameters:
data-
-
getMetadata
Returns the image metadata.- Returns:
-
getInputStream
Gets an InputStream of the backing array.- Returns:
-
getWidth
public int getWidth()Returns width of the image.- Returns:
-
getHeight
public int getHeight()Returns height of the image.- Returns:
-
hashCode
public int hashCode() -
equals
-
toString
-