Class UntiledOpImage

Object
PlanarImage
OpImage
UntiledOpImage
All Implemented Interfaces:
RenderedImage, ImageImageN, PropertyChangeEmitter, PropertySource, WritablePropertySource
Direct Known Subclasses:
ErrorDiffusionOpImage

public abstract class UntiledOpImage extends OpImage
A general class for single-source operations which require cobbled sources and create an image consisting of a single tile equal in location and size to the image bounds.

The output image will have a single tile, regardless of the ImageLayout settings passed to the constructor. Any specified settings for tile grid offset and tile dimensions will be replaced by the image origin and tile dimensions, respectively.

Subclasses should implement the computeImage method which requests computation of the entire image at once.

See Also:
  • OpImage
  • org.eclipse.imagen.operator.DCTDescriptor
  • org.eclipse.imagen.operator.DFTDescriptor
  • org.eclipse.imagen.operator.ErrorDiffusionDescriptor
  • Constructor Details

    • UntiledOpImage

      public UntiledOpImage(Vector sources, Map configuration, ImageLayout layout)
      Constructs an UntiledOpImage. The image origin and dimensions, SampleModel, and ColorModel may optionally be specified by an ImageLayout object. In all cases the tile grid offset will be set to the image origin and the tile dimensions to the image dimensions. If not specified in the ImageLayout, the image origin and dimensions are set to the corresponding attributes of the first source image. Cobbling will be performed on the source(s) as needed.
      Parameters:
      sources - The immediate sources of this image.
      configuration - Configurable attributes of the image including configuration variables indexed by RenderingHints.Keys and image properties indexed by Strings or CaselessStringKey s. This is simply forwarded to the superclass constructor.
      layout - an ImageLayout optionally containing the SampleModel, and ColorModel. The tile grid layout information will be overridden in order to ensure that the image has a single tile.
      Throws:
      IllegalArgumentException - if sources is null.
      IllegalArgumentException - If sources is non-null and any object in sources is null.
      IllegalArgumentException - if sources does not contain at least one element.
      ClassCastException - If the first object in sources is not a RenderedImage.
    • UntiledOpImage

      public UntiledOpImage(RenderedImage source, Map configuration, ImageLayout layout)
      Constructs an UntiledOpImage. The image origin and dimensions, SampleModel, and ColorModel may optionally be specified by an ImageLayout object. In all cases the tile grid offset will be set to the image origin and the tile dimensions to the image dimensions. If not specified in the ImageLayout, the image origin and dimensions are set to the corresponding attributes of the source image. Cobbling will be performed on the source as needed.
      Parameters:
      source - a RenderedImage.
      configuration - Configurable attributes of the image including configuration variables indexed by RenderingHints.Keys and image properties indexed by Strings or CaselessStringKey s. This is simply forwarded to the superclass constructor.
      layout - an ImageLayout optionally containing the SampleModel, and ColorModel. The tile grid layout information will be overridden in order to ensure that the image has a single tile.
      Throws:
      IllegalArgumentException - if source is null.
  • Method Details

    • mapSourceRect

      public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)
      Returns the image bounds.
      Specified by:
      mapSourceRect in class OpImage
      Parameters:
      sourceRect - the Rectangle in source coordinates (ignored).
      sourceIndex - the index of the source image (ignored).
      Returns:
      The image bounds.
    • mapDestRect

      public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)
      Returns the bounds of the indicated source image.
      Specified by:
      mapDestRect in class OpImage
      Parameters:
      destRect - the Rectangle in destination coordinates (ignored).
      sourceIndex - the index of the source image.
      Returns:
      The bounds of the indicated source image.
      Throws:
      IllegalArgumentException - if sourceIndex is negative or greater than the index of the last source.
    • computeTile

      public Raster computeTile(int tileX, int tileY)
      Computes a tile. All sources are cobbled together and computeImage is called to produce the single output tile.
      Overrides:
      computeTile in class OpImage
      Parameters:
      tileX - The X index of the tile.
      tileY - The Y index of the tile.
    • getTileDependencies

      public Point[] getTileDependencies(int tileX, int tileY, int sourceIndex)
      Returns an array of points indicating the tile dependencies which in this case is the set of all tiles in the specified source image.
      Overrides:
      getTileDependencies in class OpImage
      Parameters:
      tileX - the X index of the tile.
      tileY - the Y index of the tile.
      sourceIndex - the index of the source image.
      Returns:
      An array of Points indicating the source tile dependencies.