Package digilib.io
Class ImageFile
- java.lang.Object
-
- digilib.io.ImageInput
-
- digilib.io.ImageFile
-
public class ImageFile extends ImageInput
- Author:
- casties
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class digilib.io.ImageInput
ImageInput.InputTag
-
-
Field Summary
-
Fields inherited from class digilib.io.ImageInput
mimetype, pixelSize, tags, tileSize
-
-
Constructor Summary
Constructors Constructor Description ImageFile(File f, FsDirectory parentDir)
Constructor with File.ImageFile(String fn, FsDirectory dir)
Constructor with filename (without path).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check()
Checks the image and sets size and type.float
getAspect()
Returns the aspect ratio of the image (width/height).File
getFile()
Returns the input as File (if available)ImageInputStream
getImageInputStream()
Returns the input as ImageInputStream (if available)String
getMimetype()
String
getName()
Returns the file name (without path).ImageSize
getSize()
ImageSize
getTileSize()
boolean
hasFile()
Returns if the input can be returned as File.boolean
hasImageInputStream()
Returns if the input can be returned as ImageInputStream.boolean
hasTag(ImageInput.InputTag tag)
Returns if the input has the given tag.String
toString()
-
Methods inherited from class digilib.io.ImageInput
getInputStream, getTags, hasInputStream, hasMimetype, isChecked, setMimetype, setSize, setTag, setTags, setTileSize
-
-
-
-
Constructor Detail
-
ImageFile
public ImageFile(File f, FsDirectory parentDir)
Constructor with File.- Parameters:
f
- the FileparentDir
- the Directory
-
ImageFile
public ImageFile(String fn, FsDirectory dir)
Constructor with filename (without path).- Parameters:
fn
- the fndir
- the Directory
-
-
Method Detail
-
check
public void check()
Checks the image and sets size and type.
-
getSize
public ImageSize getSize()
- Overrides:
getSize
in classImageInput
- Returns:
- ImageSize
-
getTileSize
public ImageSize getTileSize()
- Overrides:
getTileSize
in classImageInput
- Returns:
- the tileSize
-
getMimetype
public String getMimetype()
- Overrides:
getMimetype
in classImageInput
- Returns:
- String
-
getAspect
public float getAspect()
Description copied from class:ImageInput
Returns the aspect ratio of the image (width/height).- Overrides:
getAspect
in classImageInput
- 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 classImageInput
- 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 classImageInput
- Returns:
- has ImageInputStream
-
getImageInputStream
public ImageInputStream getImageInputStream()
Description copied from class:ImageInput
Returns the input as ImageInputStream (if available)- Overrides:
getImageInputStream
in classImageInput
- Returns:
- the ImageInputStream
-
hasFile
public boolean hasFile()
Description copied from class:ImageInput
Returns if the input can be returned as File.- Overrides:
hasFile
in classImageInput
- Returns:
- has File
-
getFile
public File getFile()
Description copied from class:ImageInput
Returns the input as File (if available)- Overrides:
getFile
in classImageInput
- Returns:
- the File
-
-