|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.w3c.mwi.mobileok.basic.DecodedContent
org.w3c.mwi.mobileok.basic.ImageContent
org.w3c.mwi.mobileok.basic.GifImageContent
public class GifImageContent
Represents a image/gif image resource.
| Field Summary | |
|---|---|
private java.util.List<ValidationByteMessage> |
imageErrorMessageList
List of image format validation errors. |
private int |
imageHeight
Height of the image in pixels. |
private int |
imageWidth
Width of the image in pixels. |
private boolean |
transparency
True when the image uses transparency (GIF images only). |
private boolean |
valid
True when the format of the image could be validated successfully. |
| Constructor Summary | |
|---|---|
GifImageContent(java.net.URI uri,
java.util.List<RetrievalElement> retrieved)
Creates a class instance bound to a URI. |
|
| Method Summary | |
|---|---|
private boolean |
checkTransparency(RetrievalElement retrieved)
Checks whether the image/gif image uses transparency. |
java.util.List<ValidationByteMessage> |
getImageErrorMessageList()
Returns the list of image format validation error messages. |
int |
getImageHeight()
Returns the height of the image. |
java.lang.String |
getImageType()
Returns the image content-type. |
int |
getImageWidth()
Returns the width of the image. |
boolean |
hasTransparency()
Returns true when the image uses transparency. |
private boolean |
isTransparent(java.awt.Image img,
int w,
int h)
Checks whether the given image/gif image is fully transparent. |
boolean |
isValid()
Returns true when the content could be successfully
decoded. |
| Methods inherited from class org.w3c.mwi.mobileok.basic.ImageContent |
|---|
toMokiNode |
| Methods inherited from class org.w3c.mwi.mobileok.basic.DecodedContent |
|---|
addByteErrorMessages, addLineAndColumnMessages |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean valid
True when the format of the image could be validated successfully.
private int imageWidth
private int imageHeight
private boolean transparency
True when the image uses transparency (GIF images only).
private java.util.List<ValidationByteMessage> imageErrorMessageList
| Constructor Detail |
|---|
public GifImageContent(java.net.URI uri,
java.util.List<RetrievalElement> retrieved)
throws TestException
The content is validated while it is instantiated.
uri - absolute URI of the resource.retrieved - the retrieved representation of the resource.
TestException - an unexpected error occurred while retrieving the resource.| Method Detail |
|---|
private boolean checkTransparency(RetrievalElement retrieved)
throws TestException
image/gif image uses transparency.
ImageIO is used to check transparency because
JhoveBase does not provide that functionality.
retrieved - the last retrieved exchange that represents the resource.
true when the image uses transparency,
false otherwise.
TestException
private boolean isTransparent(java.awt.Image img,
int w,
int h)
throws TestException
image/gif image is fully transparent.
true when the image is fully transparent,
false otherwise.
TestExceptionpublic int getImageHeight()
ImageContent
getImageHeight in class ImageContentpublic int getImageWidth()
ImageContent
getImageWidth in class ImageContentpublic boolean hasTransparency()
ImageContenttrue when the image uses transparency.
Support for transparency may depend on the image format.
A false may thus also mean that transparency simply cannot
be used.
hasTransparency in class ImageContenttrue when the image uses transparency,
false otherwise.public boolean isValid()
DecodedContenttrue when the content could be successfully
decoded.
isValid in class DecodedContenttrue when the content is valid,
false otherwise.public java.util.List<ValidationByteMessage> getImageErrorMessageList()
ImageContent
getImageErrorMessageList in class ImageContentpublic java.lang.String getImageType()
ImageContent
getImageType in class ImageContent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||