Class AbstractImageReader<T extends AbstractImageContainer>

    • Constructor Detail

      • AbstractImageReader

        public AbstractImageReader()
    • Method Detail

      • getFormatDescription

        public abstract String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface FileFormatHandler
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public abstract String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface FileFormatHandler
        Returns:
        the extension (without the dot!)
      • isAvailable

        public boolean isAvailable()
        Returns whether the reader is actually available.
        Specified by:
        isAvailable in interface ImageReader<T extends AbstractImageContainer>
        Returns:
        true if available and ready to use
      • check

        protected void check​(PlaceholderFile file)
        Performs checks.
        Parameters:
        file - the image file to check
      • doRead

        protected abstract T doRead​(PlaceholderFile file)
        Performs the actual reading of the image file.
        Parameters:
        file - the file to read
        Returns:
        the image container, null if failed to read
      • postProcess

        protected T postProcess​(T cont,
                                PlaceholderFile file)
        Performs some post-processing on the container.
        Parameters:
        cont - the container to post-process
        file - the file that was read
        Returns:
        the (potentially) updated container
      • getReaders

        public static String[] getReaders()
        Returns a list with classnames of readers.
        Returns:
        the reader classnames