public interface Graphic
Modifier and Type | Interface and Description |
---|---|
static class |
Graphic.Compression
Enumeration of compression schemes used in Graphic files.
|
static class |
Graphic.Type
Enumeration of graphic formats.
|
Modifier and Type | Method and Description |
---|---|
int |
absoluteHeight(int pixelsPerInch)
For image formats that store such information, return the image height,
in millipoints.
|
int |
absoluteWidth(int pixelsPerInch)
For image formats that store such information, return the image width,
in millipoints.
|
boolean |
canMakeGraphicOutput(java.lang.String mimeType)
Indicates whether this Graphic instance is capable of creating a
GraphicOutput instance for a given mime type. |
void |
close()
Tells the server that the client application is done with this graphic,
which gives the server an opportunity to release any resources devoted
to this graphic.
|
int |
getBitsPerComponent()
Return the number of uncompressed bits per component for this graphic.
|
java.awt.color.ColorSpace |
getColorSpace()
Return the image color space: DeviceGray, DeviceRGB, or DeviceCMYK.
|
Graphic.Compression |
getCompressionType()
Indicates the type of compression used in this graphic.
|
byte[] |
getContent()
Return the uncompressed content of the graphic.
|
int |
getContentSize()
Return the graphic content size, in bytes (uncompressed).
|
GraphicOutput |
getGraphicOutput(java.lang.String mimeType)
Provide a
GraphicOutput implementation for a given mime type. |
Graphic.Type |
getGraphicType()
Indicates the type of this graphic.
|
GraphicLink[] |
getLinks()
Returns any links embedded in the graphic.
|
java.lang.String |
getMimeType()
Return corresponding mime type.
|
java.lang.String |
getName()
Return the name of the Graphic.
|
byte[] |
getRawSamples()
Return the raw content of the sample portion of the graphic.
|
java.awt.Color |
getTransparentColor()
Return the transparent color, if any.
|
java.net.URL |
getUrl()
Return the image URL.
|
boolean |
isInverted()
Indicates whether a graphic has its colors inverted.
|
boolean |
isTransparent()
Indicates whether this image is transparent.
|
int |
pixelHeight()
Return the image height, in pixels, if available.
|
int |
pixelWidth()
Return the image width, in pixels, if available.
|
boolean isInverted()
java.net.URL getUrl()
int pixelWidth() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.int pixelHeight() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.int absoluteWidth(int pixelsPerInch) throws GraphicException
pixelsPerInch
- The density factor that should be used if the
graphic does not know its absolute width, but does know its pixel width.
Set this value to less than one to ensure that the fallback computation
based on density will return -1 if the absolute width is not known.GraphicException
- For errors during parsing of the graphic
content.int absoluteHeight(int pixelsPerInch) throws GraphicException
pixelsPerInch
- The density factor that should be used if the
graphic does not know its absolute height, but does know its pixel
height.
Set this value to less than one to ensure that the fallback computation
based on density will return -1 if the absolute width is not known.GraphicException
- For errors during parsing of the graphic
content.java.awt.color.ColorSpace getColorSpace() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.int getBitsPerComponent() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.boolean isTransparent() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.java.awt.Color getTransparentColor() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.byte[] getRawSamples() throws GraphicException
getContent()
, and then needing to recompress it
after getting the uncompressed image.GraphicException
- For errors during parsing of the graphic
content.byte[] getContent() throws GraphicException
getColorSpace()
and the getBitsPerComponent()
indicate the number of channels, order of the channels, and number of
bits that are used to describe each image sample.GraphicException
- For errors during parsing of the graphic
content.int getContentSize() throws GraphicException
GraphicException
- For errors during parsing of the graphic
content.void close()
Graphic.Type getGraphicType()
Graphic.Compression getCompressionType() throws GraphicException
GraphicException
- If an error occurs attempting to find the
compression scheme.java.lang.String getMimeType()
java.lang.String getName()
GraphicLink[] getLinks()
GraphicOutput getGraphicOutput(java.lang.String mimeType)
GraphicOutput
implementation for a given mime type.
If the mime type is not supported, an unchecked
UnsupportedOperationException
will be thrown.
To avoid this, use canMakeGraphicOutput(String)
to check the
capability first.
The purpose of this general design pattern is to allow implementations to
support arbitrary output types.
However, interfaces for some output types are included in aXSL, and
implementations should returns instances of these types for the
corresponding mime-type:
GraphicJava2d
.GraphicPdf
.GraphicPs
.mimeType
- The mime type for which the GraphicOutput instance should
be obtained.boolean canMakeGraphicOutput(java.lang.String mimeType)
GraphicOutput
instance for a given mime type.mimeType
- The mime type for which we are checking the capability.This documentation was created 2017-01-24 at 21:26 GMT by The aXSL Group and may be freely copied. See license for details.