Package digilib.io

Class ImageFile


public class ImageFile extends ImageInput
Author:
casties
  • Constructor Details

    • 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 Details

    • check

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

      public ImageSize getSize()
      Overrides:
      getSize in class ImageInput
      Returns:
      ImageSize
    • getTileSize

      public ImageSize getTileSize()
      Overrides:
      getTileSize in class ImageInput
      Returns:
      the tileSize
    • getMimetype

      public String getMimetype()
      Overrides:
      getMimetype in class ImageInput
      Returns:
      String
    • 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
    • hasTag

      public boolean hasTag(ImageInput.InputTag tag)
      Description copied from class: ImageInput
      Returns if the input has the given tag. Always matches if tag==null.
      Overrides:
      hasTag in class ImageInput
      Parameters:
      tag -
      Returns:
    • 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
    • getImageInputStream

      public ImageInputStream getImageInputStream()
      Description copied from class: ImageInput
      Returns the input as ImageInputStream (if available)
      Overrides:
      getImageInputStream in class ImageInput
      Returns:
      the 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
    • toString

      public String toString()
      Overrides:
      toString in class Object