Interface TileSink
- All Known Implementing Classes:
AbstractDelegatingTileSink, AbstractTileSink, DefaultTileSink
public interface TileSink
A sink for writing generated IIIF image tiles.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordSink contribution toinfo.json. -
Method Summary
Modifier and TypeMethodDescriptiondefault List<OptionDescriptor> Introspects the configuration options accepted bysetOptions(Map).default Stringdefault TileSink.InfoExtensionContributes sink-specific entries to theinfo.jsondocument.getName()voidsaveTile(OutputStream outputStream, BufferedImage image, Map<String, Object> metadata) Saves a given image tile to the specified path.default voidsetOptions(Map<String, String> options) Sets configuration options for this tile sink.default booleanWhether this sink consumes HDR content (hdr.*metadata keys) when the source offers it.
-
Method Details
-
saveTile
void saveTile(OutputStream outputStream, BufferedImage image, Map<String, Object> metadata) throws TileSinkExceptionSaves 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
-
getDescription
- Returns:
- Short human-readable description of this sink (used by
info list-sinks).
-
getAvailableOptions
Introspects the configuration options accepted bysetOptions(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
Tileronly 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:
trueif this sink reads HDR metadata keys.
-
getInfoJsonExtension
Contributes sink-specific entries to theinfo.jsondocument.Called by the
Tilerafter 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 namespacedtrust-anchorwith Image API 2, whose fixed@contextoffers no place for extension properties).
-