Class ImageFileEncoding

Object
ImageFileEncoding

public final class ImageFileEncoding extends Object
How values are encoded into an image-file.
Author:
Owen Feehan
  • Constructor Details

    • ImageFileEncoding

      public ImageFileEncoding(boolean rgb, boolean interleaved, int numberChannelsPerArray)
      Creates a new ImageFileEncoding instance.
      Parameters:
      rgb - Whether the source bytes encoded as RGB (i.e. with the three colors coded into a 4 bytes coding per voxel).
      interleaved - Whether the channels are interleaved

      Interleaving means that voxels from successive channels are directly adjacent. Otherwise, each channel's voxels are contiguous.

      numberChannelsPerArray - The total number of channels found in any one buffer.

      For an RGB image, this is by definition three.

  • Method Details

    • numberDistinctChannelsSource

      public int numberDistinctChannelsSource() throws IOException
      When RGB-encoded and non-interleaved, the source array is considered 1 channel (not three).

      When not RGB encoded, it describes the number of interleaved channels present.

      Returns:
      the number of channels as per above, which must always be positive.
      Throws:
      IOException - if numberChannelsPerArray is zero, and the image is either non-RGB or interleaved.
    • isRgb

      public boolean isRgb()
      Whether the source bytes encoded as RGB (i.e. with the three colors coded into a 4 bytes coding per voxel).
    • isInterleaved

      public boolean isInterleaved()
      Whether the channels are interleaved

      Interleaving means that voxels from successive channels are directly adjacent. Otherwise, each channel's voxels are contiguous.

    • getNumberChannelsPerArray

      public int getNumberChannelsPerArray()
      The total number of channels found in any one buffer.

      For an RGB image, this is by definition three.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object