Class UIntPixArray


final class UIntPixArray extends IntPixArray
A representation of an array of unsigned int pixels, with intensity range 0..16777215. Note that all pixel values stored and accessed by this class are of the primitive type int. It is up the user to convert these to unsigned before the pixel values are used. This would typically be done using a statement like:
long l = (long) (pixel[i] & 0xFFFFFFFFl);
  • Method Details

    • getHisto

      public int[] getHisto(int nbins) throws InvalidImageException
      Computes a histogram of a UIntPixArray.
      Overrides:
      getHisto in class IntPixArray
      Parameters:
      nbins - the number of bins in the histogram.
      Returns:
      an int[] of length 2 where the first element is the number of pixels of value false and the second element is the number of pixels of value true.
      Throws:
      InvalidImageException - if the histogram can't be computed.
    • getPutPix

      public Object getPutPix(Object pix, int[] pixIdx, PixelOp op) throws IllegalArgumentException
      Gets/puts a single pixel value from/to an an image. Returns a java Long cast to Object corresponding to the picture primitve type. This represents the pixel intensity value for the pixel indexed by each element of pixIdx, and is returned as a Long (rather than an Integer) since an Integer value does not have the dynamic range to represent an unsigned int value.
      Overrides:
      getPutPix in class IntPixArray
      Parameters:
      pix - a pixel value for a put operation or null for a get operation; if non-null, this must be a java.lang.Long.
      pixIdx - an array of length at least nDim with elements 0 to nDim-1 equal to the index in that image dimension.
      op - the type of operation (GET or PUT).
      Returns:
      a pixel value for a get operation or the supplied pixel for a put operation.
      Throws:
      IllegalArgumentException - if the pixIdx is bad or of the wrong data type