public class RegionRequest extends Object
| Constructor and Description |
|---|
RegionRequest()
Create a region that encompasses the whole picture, i.e.
|
RegionRequest(boolean square)
Pass ‘true’ to create a region that selects a square region from the image, i.e.
|
RegionRequest(double x,
double y,
double width,
double height)
Create a RegionRequest request that is expressed using relative values, i.e.
|
RegionRequest(int x,
int y,
int width,
int height)
Create a RegionRequest request that is expressed using absolute values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static RegionRequest |
fromString(String str)
Parse an IIIF Image API compliant region request string
|
String |
getCanonicalForm(Dimension imageDims) |
Rectangle2D |
getRegion()
Returns the requested region
|
int |
hashCode() |
boolean |
isRelative()
Returns whether the region is epxressed in relative terms.
|
boolean |
isSquare()
Returns whether a square region is selected.
|
Rectangle |
resolve(Dimension imageDims)
Resolve the region request into an actual region that can be used for cropping the image
|
String |
toString()
Create an IIIF Image API compliant region request string
|
public RegionRequest()
Create a region that encompasses the whole picture, i.e. the ‘full’ syntax.
public RegionRequest(boolean square)
Pass ‘true’ to create a region that selects a square region from the image, i.e. the ‘square’ syntax.
public RegionRequest(double x,
double y,
double width,
double height)
throws ResolvingException
Create a RegionRequest request that is expressed using relative values, i.e. the “pct:x,y,w,h” syntax
The values must be between 0.0 and 100.0.
ResolvingException - if the values fall outside of the allowed rangepublic RegionRequest(int x,
int y,
int width,
int height)
Create a RegionRequest request that is expressed using absolute values.
public static RegionRequest fromString(String str) throws ResolvingException
Parse an IIIF Image API compliant region request string
ResolvingException - if the request string is malformed.public Rectangle2D getRegion()
Returns the requested region
public boolean isRelative()
Returns whether the region is epxressed in relative terms.
public boolean isSquare()
Returns whether a square region is selected.
public String toString()
Create an IIIF Image API compliant region request string
public String getCanonicalForm(Dimension imageDims) throws ResolvingException
ResolvingExceptionpublic Rectangle resolve(Dimension imageDims) throws ResolvingException
Resolve the region request into an actual region that can be used for cropping the image
ResolvingExceptionCopyright © 2018. All rights reserved.