Interface PixelImage

All Known Subinterfaces:
BilevelImage, ByteChannelImage, Gray16Image, Gray8Image, GrayIntegerImage, IntegerImage, Paletted8Image, PalettedIntegerImage, RGB24Image, RGB48Image, RGBImage, RGBIntegerImage, ShortChannelImage
All Known Implementing Classes:
BufferedRGB24Image, MemoryBilevelImage, MemoryByteChannelImage, MemoryGray16Image, MemoryGray8Image, MemoryPaletted8Image, MemoryRGB24Image, MemoryRGB48Image, MemoryShortChannelImage

public interface PixelImage
The base interface for all image data types in JIU. These image data classes and interfaces share the following properties:
  • They are made up of a rectangular grid of pixels (color dots) and have a fixed width (horizontal number of pixels) and height (vertical number of pixels).
  • Coordinates to access pixels in the image are defined to run from 0 to WIDTH - 1 in horizontal direction from left to right and in vertical direction from 0 to HEIGHT - 1 (from top to bottom).
  • They have one or more channels. A pixel at a given position is made up of the samples (primitive values) of all the channels at that position. A pixel can thus be considered a vector (in the mathematical sense) of one or more samples. Each channel has the same width and height.
Author:
Marco Schmidt
  • Method Summary

    Modifier and Type
    Method
    Description
    createCompatibleImage(int width, int height)
    Creates an instance of the same class as this one, with width and height given by the arguments.
    Creates an new image object that will be of the same type as this one, with the same image data, using entirely new resources.
    long
    Returns the number of bytes that were dynamically allocated for this image object.
    int
    Returns the number of bits per pixel of this image.
    int
    Returns the vertical resolution of the image in pixels.
    If there is a single interface or class that describes the image data type of this class, the Class object associated with that interface (or class) is returned (or null otherwise).
    int
    Returns the number of channels in this image.
    int
    Returns the horizontal resolution of the image in pixels.
  • Method Details

    • createCompatibleImage

      PixelImage createCompatibleImage(int width, int height)
      Creates an instance of the same class as this one, with width and height given by the arguments.
      Parameters:
      width - the horizontal resolution of the new image
      height - the vertical resolution of the new image
      Returns:
      the new image
      Throws:
      IllegalArgumentException - if width or height are smaller than one
    • createCopy

      PixelImage createCopy()
      Creates an new image object that will be of the same type as this one, with the same image data, using entirely new resources.
      Returns:
      the new image object
    • getAllocatedMemory

      long getAllocatedMemory()
      Returns the number of bytes that were dynamically allocated for this image object.
      Returns:
      allocated memory in bytes
    • getBitsPerPixel

      int getBitsPerPixel()
      Returns the number of bits per pixel of this image. That is the number of bits per sample for all channels of this image. Does not include any transparency channels.
    • getHeight

      int getHeight()
      Returns the vertical resolution of the image in pixels. Must be one or larger.
      Returns:
      height in pixels
    • getImageType

      Class getImageType()
      If there is a single interface or class that describes the image data type of this class, the Class object associated with that interface (or class) is returned (or null otherwise). This Class object, if available for two image objects, can be used to find out if they are compatible. Example: MemoryGray8Image returns net.sourceforge.jiu.data.Gray8Image.class.
    • getNumChannels

      int getNumChannels()
      Returns the number of channels in this image. Must be one or larger.
      Returns:
      the number of channels
    • getWidth

      int getWidth()
      Returns the horizontal resolution of the image in pixels. Must be one or larger.
      Returns:
      width in pixels