Package digilib.io
Class ImageInput
java.lang.Object
digilib.io.ImageInput
- Direct Known Subclasses:
ImageFile,ImageStream,ImageUrl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumtags to characterise image type for processing -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns 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()booleanhasFile()Returns if the input can be returned as File.booleanReturns if the input can be returned as ImageInputStream.booleanReturns if the input can be returned as InputStream.booleanreturns if mimetype has been set.booleanReturns if the input has the given tag.booleanreturns if this image has been checked (i.e.voidsetMimetype(String filetype) Sets the mimetype.voidSets the imageSize.voidSets the given tag on the input.voidsetTags(EnumSet<ImageInput.InputTag> tags) voidsetTileSize(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
-