Package digilib.io
Class ImageInput
- java.lang.Object
-
- digilib.io.ImageInput
-
- Direct Known Subclasses:
ImageFile
,ImageStream
,ImageUrl
public abstract class ImageInput extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageInput.InputTag
tags to characterise image type for processing
-
Constructor Summary
Constructors Constructor Description ImageInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)InputStream
getInputStream()
Returns the input as InputStream (if available)String
getMimetype()
ImageSize
getSize()
EnumSet<ImageInput.InputTag>
getTags()
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
hasInputStream()
Returns if the input can be returned as InputStream.boolean
hasMimetype()
returns if mimetype has been set.boolean
hasTag(ImageInput.InputTag tag)
Returns if the input has the given tag.boolean
isChecked()
returns if this image has been checked (i.e.void
setMimetype(String filetype)
Sets the mimetype.void
setSize(ImageSize imageSize)
Sets the imageSize.void
setTag(ImageInput.InputTag tag)
Sets the given tag on the input.void
setTags(EnumSet<ImageInput.InputTag> tags)
void
setTileSize(ImageSize tileSize)
-
-
-
Field Detail
-
mimetype
protected String mimetype
mime file type
-
pixelSize
protected ImageSize pixelSize
image size in pixels
-
tileSize
protected ImageSize tileSize
image tile size (null if untiled)
-
tags
protected EnumSet<ImageInput.InputTag> tags
InputTags for this input
-
-
Method Detail
-
getSize
public ImageSize getSize()
- Returns:
- ImageSize
-
setSize
public void setSize(ImageSize imageSize)
Sets the imageSize.- Parameters:
imageSize
- The imageSize to set
-
getTileSize
public ImageSize getTileSize()
- Returns:
- the tileSize
-
setTileSize
public void setTileSize(ImageSize tileSize)
- Parameters:
tileSize
- the tileSize to set
-
hasMimetype
public boolean hasMimetype()
returns if mimetype has been set.- Returns:
- String
-
getMimetype
public String getMimetype()
- Returns:
- String
-
setMimetype
public void setMimetype(String filetype)
Sets the mimetype.- Parameters:
filetype
- The mimetype to set
-
getTags
public EnumSet<ImageInput.InputTag> getTags()
- Returns:
- the tags
-
setTags
public void setTags(EnumSet<ImageInput.InputTag> tags)
- Parameters:
tags
- the tags to set
-
hasTag
public boolean hasTag(ImageInput.InputTag tag)
Returns if the input has the given tag. Always matches if tag==null.- Parameters:
tag
-- Returns:
-
setTag
public void setTag(ImageInput.InputTag tag)
Sets the given tag on the input.- Parameters:
tag
- the tag to set
-
isChecked
public boolean isChecked()
returns if this image has been checked (i.e. has size and mimetype) TODO: deprecated- Returns:
- is checked
-
getAspect
public float getAspect()
Returns the aspect ratio of the image (width/height).- Returns:
- the aspect ratio
-
hasImageInputStream
public boolean hasImageInputStream()
Returns if the input can be returned as ImageInputStream.- Returns:
- has ImageInputStream
-
getImageInputStream
public ImageInputStream getImageInputStream()
Returns the input as ImageInputStream (if available)- Returns:
- the ImageInputStream
-
hasInputStream
public boolean hasInputStream()
Returns if the input can be returned as InputStream.- Returns:
- has InputStream
-
getInputStream
public InputStream getInputStream()
Returns the input as InputStream (if available)- Returns:
- the InputStream
-
hasFile
public boolean hasFile()
Returns if the input can be returned as File.- Returns:
- has File
-
getFile
public File getFile()
Returns the input as File (if available)- Returns:
- the File
-
-