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
  • Constructor Details

    • ImageDataCompressed

      public ImageDataCompressed​(UByteArray image, int width, int height, ImageMetadata imageMetadata)
      Constructor from the wrapped array of values.
      Parameters:
      image -
      width -
      height -
      imageMetadata -
    • ImageDataCompressed

      public ImageDataCompressed​(int[] image, int width, int height, ImageMetadata imageMetadata)
      Constructor from the array of the real unsigned values. Wrapps the ints into UByteArray by checking the maximal value which unsigned byte can hold.
      Parameters:
      image -
      width -
      height -
      imageMetadata -
    • ImageDataCompressed

      public ImageDataCompressed​(UByteArray image, int width, int height, long recorderImageNumber, PcoMetadataStruct metadataBean, Timestamp timestamp)
      Constructor from the wrapped array of values and from the metadata subobjects.
      Parameters:
      image -
      width -
      height -
      recorderImageMetadata -
      pcoMetadataStruct -
      timestamp -
  • Method Details

    • isCompressed

      public boolean isCompressed()
      Returns always true because ImageData are based on UByteArray.
      Specified by:
      isCompressed in class AbstractImageData
    • 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:
      setData in class AbstractImageData
      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:
      getDataElementMaxValue in class AbstractImageData
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractImageData
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class AbstractImageData
    • toString

      public String toString()
      Overrides:
      toString in class AbstractImageData