Class ImageOverlay

java.lang.Object
is.galia.operation.overlay.Overlay
is.galia.operation.overlay.ImageOverlay
All Implemented Interfaces:
Operation

public class ImageOverlay extends Overlay implements Operation

Encapsulates an image overlaid on top of another image.

Instances should be obtained from the OverlayFactory.

  • Constructor Details

    • ImageOverlay

      public ImageOverlay(URI uri, Position position, int inset)
      Constructor for images that reside on a web server.
      Parameters:
      uri - Image URI, which may be a file URI.
      position - Position of the overlay.
      inset - Inset in pixels.
  • Method Details

    • getURI

      public URI getURI()
      For reading the image, clients should use openStream() instead.
      Returns:
      URI of the image.
    • openStream

      public ImageInputStream openStream() throws IOException
      Returns:
      Stream from which the image can be read.
      Throws:
      IOException
    • setURI

      public void setURI(URI uri)
      Parameters:
      uri - Image URI, which may be a file URI.
      Throws:
      IllegalStateException - If the instance is frozen.
    • toMap

      public Map<String,Object> toMap(Size fullSize, ScaleConstraint scaleConstraint)
      Specified by:
      toMap in interface Operation
      Parameters:
      fullSize - Full size of the source image on which the operation is being applied.
      scaleConstraint - Scale constraint applied to the given full size.
      Returns:
      Map with identifier, position, and inset keys.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String representation of the instance, in the format [URI]_[position]_[inset].