Class ColourPackedPixArray


public final class ColourPackedPixArray extends RGBInterlacedPixArray
A representation of an array of (UNC) color packed (r,g,b,a) 4-byte pixels. Note that all pixel values handled by this class are of the primitive byte class. However, it is up to the user to convert these to unsigned before the pixel values are used. This would typically be done using a statements like:

short r = (short) (pixel[4*i] & 0xFF);
short g = (short) (pixel[4*i+1] & 0xFF);
short b = (short) (pixel[4*i+2] & 0xFF);
short a = (short) (pixel[4*i+3] & 0xFF);
  • Method Details

    • write

      public long write(BufferedOutputStream s, ByteOrder byteOrder) throws IOException
      Writes this ColourPackedPixArray object to a BufferedOutputStream. All pixels are written.
      Overrides:
      write in class BytePixArray
      Parameters:
      s - the BufferedOutputStream.
      byteOrder - is ignored.
      Returns:
      the number of bytes written.
      Throws:
      IOException - if the data cannot be written.