Package digilib.io

Class ImageFile


  • public class ImageFile
    extends ImageInput
    Author:
    casties
    • Constructor Detail

      • ImageFile

        public ImageFile​(File f,
                         FsDirectory parentDir)
        Constructor with File.
        Parameters:
        f - the File
        parentDir - the Directory
      • ImageFile

        public ImageFile​(String fn,
                         FsDirectory dir)
        Constructor with filename (without path).
        Parameters:
        fn - the fn
        dir - the Directory
    • Method Detail

      • check

        public void check()
        Checks the image and sets size and type.
      • getAspect

        public float getAspect()
        Description copied from class: ImageInput
        Returns the aspect ratio of the image (width/height).
        Overrides:
        getAspect in class ImageInput
        Returns:
        the aspect ratio
      • getName

        public String getName()
        Returns the file name (without path).
        Returns:
        the name
      • hasImageInputStream

        public boolean hasImageInputStream()
        Description copied from class: ImageInput
        Returns if the input can be returned as ImageInputStream.
        Overrides:
        hasImageInputStream in class ImageInput
        Returns:
        has ImageInputStream
      • hasFile

        public boolean hasFile()
        Description copied from class: ImageInput
        Returns if the input can be returned as File.
        Overrides:
        hasFile in class ImageInput
        Returns:
        has File
      • getFile

        public File getFile()
        Description copied from class: ImageInput
        Returns the input as File (if available)
        Overrides:
        getFile in class ImageInput
        Returns:
        the File