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 Details

  • Constructor Details

    • AbstractImageData

      protected AbstractImageData​(AbstractUnsignedArray image, int width, int height)
      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

      protected AbstractImageData​(int[] image, int width, int height, ImageMetadata metadata)
      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 by getDataElementMaxValue().
      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

      public ImageMetadata getMetadata()
      Returns the image metadata.
      Returns:
    • getInputStream

      public InputStream 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()
      Overrides:
      hashCode in class Object
    • equals

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

      public String toString()
      Overrides:
      toString in class Object