Package ome.io.nio

Class ReorderedPixelData


  • public class ReorderedPixelData
    extends ome.util.PixelData
    Represents a block of pixel data that needs to be re-ordered in accordance with a DeltaVision file. NOTE: This buffer does not re-order the actual backing buffer so read-only buffers may be used and potential callers of getData() should be aware of this restriction.
    Since:
    3.0
    See Also:
    PixelData
    • Field Summary

      • Fields inherited from class ome.util.PixelData

        BIT, BYTE, bytesPerPixel, CONFIG_KEY, data, DOUBLE, FLOAT, INT, isFloat, isSigned, javaType, LONG, maximum, minimum, pixelsType, SHORT
    • Constructor Summary

      Constructors 
      Constructor Description
      ReorderedPixelData​(java.lang.String pixelsType, java.nio.ByteBuffer data, int rowSize)
      Default constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer getData()
      Returns the backing buffer for the pixel data.
      java.nio.ByteOrder getOrder()
      Returns the byte order of the backing buffer.
      double getPixelValueDirect​(int offset)
      Returns the pixel intensity value of the pixel at a given offset within the backing buffer.
      static int getReorderedPixelOffset​(int size, int offset, int rowSize)
      Returns the re-ordered pixel offset.
      void setOrder​(java.nio.ByteOrder order)
      Set the byte order of the backing buffer.
      • Methods inherited from class ome.util.PixelData

        bytesPerPixel, dispose, getBitDepth, getMaximum, getMinimum, getPixelValue, in, isFloat, isSigned, javaType, setPixelValue, setPixelValueDirect, size
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReorderedPixelData

        public ReorderedPixelData​(java.lang.String pixelsType,
                                  java.nio.ByteBuffer data,
                                  int rowSize)
        Default constructor.
        Parameters:
        pixelsType - The OME pixels type.
        data - The raw pixel data.
        rowSize - The size of each pixels row in bytes.
    • Method Detail

      • getReorderedPixelOffset

        public static int getReorderedPixelOffset​(int size,
                                                  int offset,
                                                  int rowSize)
        Returns the re-ordered pixel offset.
        Parameters:
        size - The number of rows in the array.
        offset - The offset within the array of rows assuming a top left origin.
        rowSize - The size of each pixels row in bytes.
        Returns:
        See above.
      • getPixelValueDirect

        public double getPixelValueDirect​(int offset)
        Returns the pixel intensity value of the pixel at a given offset within the backing buffer. This method does not take into account bytes per pixel.
        Overrides:
        getPixelValueDirect in class ome.util.PixelData
        Parameters:
        offset - The absolute offset within the backing buffer.
        Returns:
        The intensity value.
      • getData

        public java.nio.ByteBuffer getData()
        Returns the backing buffer for the pixel data.
        Overrides:
        getData in class ome.util.PixelData
        Returns:
        See above.
      • getOrder

        public java.nio.ByteOrder getOrder()
        Returns the byte order of the backing buffer.
        Overrides:
        getOrder in class ome.util.PixelData
        Returns:
        See above.
      • setOrder

        public void setOrder​(java.nio.ByteOrder order)
        Set the byte order of the backing buffer.
        Overrides:
        setOrder in class ome.util.PixelData
        Parameters:
        order - The byte order.