Interface TileSink

All Known Implementing Classes:
AbstractDelegatingTileSink, AbstractTileSink, DefaultTileSink

public interface TileSink
A sink for writing generated IIIF image tiles.
  • Method Details

    • saveTile

      void saveTile(OutputStream outputStream, BufferedImage image, Map<String,Object> metadata) throws TileSinkException
      Saves a given image tile to the specified path.
      Parameters:
      outputStream - The destination stream for the tile.
      image - The image data to save.
      Throws:
      TileSinkException - if an error occurs during saving.
    • getFormatExtension

      String getFormatExtension()
      Returns:
      The file extension for the format this sink writes (e.g., "jpg", "png").
    • getName

      String getName()
      Returns:
      The unique name for this sink implementation (e.g., "default", "jpeg").
    • setOptions

      default void setOptions(Map<String,String> options)
      Sets configuration options for this tile sink.
      Parameters:
      options - A map of key-value pairs.
    • getDescription

      default String getDescription()
      Returns:
      Short human-readable description of this sink (used by info list-sinks).
    • getAvailableOptions

      default List<OptionDescriptor> getAvailableOptions()
      Introspects the configuration options accepted by setOptions(Map).
      Returns:
      Descriptors with name and description (plus default, required flag and type hint); empty when this sink takes no options.
    • supportsHdr

      default boolean supportsHdr()
      Whether this sink consumes HDR content (hdr.* metadata keys) when the source offers it.

      The Tiler only materializes and attaches HDR payloads for sinks opting in here, so unaware sinks neither see nor pay for HDR. Additive default — existing implementations behave exactly as before.

      Returns:
      true if this sink reads HDR metadata keys.
    • getInfoJsonExtension

      default TileSink.InfoExtension getInfoJsonExtension(ImageInfo.IIIFVersion version)
      Contributes sink-specific entries to the info.json document.

      Called by the Tiler after the base document has been built. The default implementation advertises nothing.

      Parameters:
      version - The IIIF Image API version being generated.
      Returns:
      The extension fragment; never null.
      Throws:
      IllegalArgumentException - if the current options cannot be expressed for the requested version (e.g. a namespaced trust-anchor with Image API 2, whose fixed @context offers no place for extension properties).