Package digilib.io
Class ImageFile
java.lang.Object
digilib.io.ImageInput
digilib.io.ImageFile
- 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
ConstructorsConstructorDescriptionImageFile
(File f, FsDirectory parentDir) Constructor with File.ImageFile
(String fn, FsDirectory dir) Constructor with filename (without path). -
Method Summary
Modifier and TypeMethodDescriptionvoid
check()
Checks the image and sets size and type.float
Returns the aspect ratio of the image (width/height).getFile()
Returns the input as File (if available)Returns the input as ImageInputStream (if available)getName()
Returns the file name (without path).getSize()
boolean
hasFile()
Returns if the input can be returned as File.boolean
Returns if the input can be returned as ImageInputStream.boolean
Returns if the input has the given tag.toString()
Methods inherited from class digilib.io.ImageInput
getInputStream, getTags, hasInputStream, hasMimetype, isChecked, setMimetype, setSize, setTag, setTags, setTileSize
-
Constructor Details
-
ImageFile
Constructor with File.- Parameters:
f
- the FileparentDir
- the Directory
-
ImageFile
Constructor with filename (without path).- Parameters:
fn
- the fndir
- the Directory
-
-
Method Details
-
check
public void check()Checks the image and sets size and type. -
getSize
- Overrides:
getSize
in classImageInput
- Returns:
- ImageSize
-
getTileSize
- Overrides:
getTileSize
in classImageInput
- Returns:
- the tileSize
-
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
Description copied from class:ImageInput
Returns if the input has the given tag. Always matches if tag==null.- Overrides:
hasTag
in classImageInput
- Parameters:
tag
-- Returns:
-
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
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
Description copied from class:ImageInput
Returns the input as File (if available)- Overrides:
getFile
in classImageInput
- Returns:
- the File
-
toString
-