Package de.pco.common
Class ImageDataCompressed
java.lang.Object
de.pco.common.AbstractImageData
de.pco.common.ImageDataCompressed
public class ImageDataCompressed extends AbstractImageData
Class represents the image as unsigned byte[] and its metadata .
- Author:
- PCO
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ImageDataCompressed(int[] image, int width, int height)Constructor from the array of the real unsigned values.ImageDataCompressed(UByteArray image, int width, int height)Constructor from the wrapped array of values, without the metadata.ImageDataCompressed(UByteArray image, AbstractMetadata metadata)Constructor from the wrapped array of values and from the metadata which contains also the width and the height. -
Method Summary
Modifier and Type Method Description intgetDataElementMaxValue()Returns the maximal value that can be stored in the returned data array: 255 which is the maximum of unsigned byte.booleanisCompressed()Returns always true because ImageData are based on UByteArray.voidsetData(int[] data)Sets the image data.Methods inherited from class de.pco.common.AbstractImageData
equals, getData, getHeight, getInputStream, getMetadata, getWidth, hashCode, toString
-
Constructor Details
-
ImageDataCompressed
Constructor from the wrapped array of values, without the metadata.- Parameters:
image-width-height-
-
ImageDataCompressed
Constructor from the wrapped array of values and from the metadata which contains also the width and the height.- Parameters:
image-metadata-
-
ImageDataCompressed
public ImageDataCompressed(int[] image, int width, int height)Constructor from the array of the real unsigned values. Wrapps the ints intoUByteArrayby checking the maximal value which unsigned byte can hold.- Parameters:
image-width-height-
-
-
Method Details
-
isCompressed
public boolean isCompressed()Returns always true because ImageData are based on UByteArray.- Specified by:
isCompressedin classAbstractImageData- Returns:
-
setData
public void setData(int[] data)Sets the image data. Checks the parameter whether all the data values fit in an unsigned byte.- Specified by:
setDatain classAbstractImageData- Parameters:
data-
-
getDataElementMaxValue
public final int getDataElementMaxValue()Returns the maximal value that can be stored in the returned data array: 255 which is the maximum of unsigned byte.- Specified by:
getDataElementMaxValuein classAbstractImageData- Returns:
-