Package digilib.io
Class ImageInput
java.lang.Object
digilib.io.ImageInput
- Direct Known Subclasses:
ImageFile
,ImageStream
,ImageUrl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
tags to characterise image type for processing -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the aspect ratio of the image (width/height).getFile()
Returns the input as File (if available)Returns the input as ImageInputStream (if available)Returns the input as InputStream (if available)getSize()
getTags()
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 can be returned as InputStream.boolean
returns if mimetype has been set.boolean
Returns if the input has the given tag.boolean
returns if this image has been checked (i.e.void
setMimetype
(String filetype) Sets the mimetype.void
Sets the imageSize.void
Sets the given tag on the input.void
setTags
(EnumSet<ImageInput.InputTag> tags) void
setTileSize
(ImageSize tileSize)
-
Field Details
-
mimetype
mime file type -
pixelSize
image size in pixels -
tileSize
image tile size (null if untiled) -
tags
InputTags for this input
-
-
Constructor Details
-
ImageInput
public ImageInput()
-
-
Method Details
-
getSize
- Returns:
- ImageSize
-
setSize
Sets the imageSize.- Parameters:
imageSize
- The imageSize to set
-
getTileSize
- Returns:
- the tileSize
-
setTileSize
- Parameters:
tileSize
- the tileSize to set
-
hasMimetype
public boolean hasMimetype()returns if mimetype has been set.- Returns:
- String
-
getMimetype
- Returns:
- String
-
setMimetype
Sets the mimetype.- Parameters:
filetype
- The mimetype to set
-
getTags
- Returns:
- the tags
-
setTags
- Parameters:
tags
- the tags to set
-
hasTag
Returns if the input has the given tag. Always matches if tag==null.- Parameters:
tag
-- Returns:
-
setTag
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
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
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
Returns the input as File (if available)- Returns:
- the File
-