|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.panama.imagex.ImageX
This class provides some simple image format transformation functionality for formats supported by mobile devices, such as GIF, BMP and WBMP. Spatial Services such as routing and mapping return map image URLs. Unfortunately, the type of image format can not generally be influenced but depends on the particular mapping server. This API offers the functionality to transform an image at a given source URL to an image at given target URL. The user of this class has to provide a URL that can be written to. Furthermore, he has to organize garbage collection of images that are not needed any more. For the original image URL returned by the mapping server, this is not necessary.
Constructor Summary |
ImageX()
|
Method Summary |
Type | Method |
---|---|
static void |
convertFormat(java.lang.String sourceURL,
java.io.OutputStream targetStream,
ImageFormats targetFormat,
double scaleX,
double scaleY)
This function transforms an image from one image format to another. |
static void |
convertFormat(java.lang.String sourceURL,
java.io.OutputStream targetStream,
ImageFormats targetFormat,
int maxSizeX,
int maxSizeY)
This function transforms an image from one image format to another. |
static void |
convertFormat(java.lang.String sourceURL,
java.lang.String targetFile,
ImageFormats targetFormat)
This function transforms an image from one image format to another. |
static void |
convertFormat(java.lang.String sourceURL,
java.lang.String targetFile,
ImageFormats targetFormat,
double scaleX,
double scaleY)
This function transforms an image from one image format to another. |
static void |
flipAntiDiagonal(java.lang.String sourceURL,
java.lang.String targetFile)
This function flips the original image antidiagonally and writes the result as a BMP image into the target URL. |
static void |
flipDiagonal(java.lang.String sourceURL,
java.lang.String targetFile)
This function flips the original image diagonally and writes the result as a BMP image into the target URL. |
static void |
flipHorizontal(java.lang.String sourceURL,
java.lang.String targetFile)
This function flips the original image horizontally and writes the result as a BMP image into the target URL. |
static void |
flipVertical(java.lang.String sourceURL,
java.lang.String targetFile)
This function flips the original image vertically and writes the result as a BMP image into the target URL. |
static java.lang.String |
getConvertedImageURL(java.lang.String sourceURL,
java.lang.String transformationJSP,
ImageFormats targetFormat,
double scaleX,
double scaleY)
This function transforms an image from one image format to another. |
static java.lang.String |
getConvertedImageURL(java.lang.String sourceURL,
java.lang.String transformationJSP,
ImageFormats targetFormat,
int maxSizeX,
int maxSizeY)
This function transforms an image from one image format to another. |
static void |
main(java.lang.String[] args)
|
static void |
rotate180(java.lang.String sourceURL,
java.lang.String targetFile)
This function rotates the original image by 180 degrees (with the clock) and writes the result as a BMP image into the target URL. |
static void |
rotate270(java.lang.String sourceURL,
java.lang.String targetFile)
This function rotates the original image by 270 degrees (with the clock) and writes the result as a BMP image into the target URL. |
static void |
rotate90(java.lang.String sourceURL,
java.lang.String targetFile)
This function rotates the original image by 90 degrees (with the clock) and writes the result as a BMP image into the target URL. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImageX()
Method Detail |
public static void convertFormat(java.lang.String sourceURL, java.lang.String targetFile, ImageFormats targetFormat) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the file name of the target
imagetargetFormat
- an ImageFormats object representing the target image
format, to which the original image should be
convertedpublic static void convertFormat(java.lang.String sourceURL, java.lang.String targetFile, ImageFormats targetFormat, double scaleX, double scaleY) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the file name of the target
imagetargetFormat
- an ImageFormats object representing the target image
format, to which the original image should be
convertedscaleX
- a double representing the horizontal scale factor;
a factor above 1.0 results in enlargement of the imagescaleY
- a double representing the vertical scale factor;
a factor above 1.0 results in enlargement of the imagepublic static java.lang.String getConvertedImageURL(java.lang.String sourceURL, java.lang.String transformationJSP, ImageFormats targetFormat, double scaleX, double scaleY) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original
image to be converted or scaledtransformationJSP
- a String representing the URL of the
transformation JSP file (this JSP file is
supplied in the sample directory
.../sample/sampleadapter/spatial/jsp/)targetFormat
- an ImageFormats object representing the target
image format, to which the original image
should be convertedscaleX
- a double representing the horizontal scale
factor; a factor above 1.0 results in
enlargement of the imagescaleY
- a double representing the vertical scale
factor; a factor above 1.0 results in
enlargement of the imagepublic static java.lang.String getConvertedImageURL(java.lang.String sourceURL, java.lang.String transformationJSP, ImageFormats targetFormat, int maxSizeX, int maxSizeY) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original
image to be converted or scaledtransformationJSP
- a String representing the URL of the
transformation JSP file (this JSP file is
supplied in the sample directory
.../sample/sampleadapter/spatial/jsp/)targetFormat
- an ImageFormats object representing the target
image format, to which the original image
should be convertedmaxSizeX
- an int representing the maximum horizontal
image size (typically the horizontal resolution
of the device). The preserve the aspect ratio,
the actual horizontal image size might be lower
than the maximum to keep the vertical image
size at or below its maximummaxSizeY
- an int representing the maximum vertical
image size (typically the vertical resolution
of the device). The preserve the aspect ratio,
the actual vertical image size might be lower
than the maximum to keep the horizontal image
size at or below its maximumpublic static void convertFormat(java.lang.String sourceURL, java.io.OutputStream targetStream, ImageFormats targetFormat, double scaleX, double scaleY) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetStream
- an OutputStream for the target imagetargetFormat
- an ImageFormats object representing the target image
format, to which the original image should be
convertedscaleX
- a double representing the horizontal scale factor;
a factor above 1.0 results in enlargement of the imagescaleY
- a double representing the vertical scale factor;
a factor above 1.0 results in enlargement of the imagepublic static void convertFormat(java.lang.String sourceURL, java.io.OutputStream targetStream, ImageFormats targetFormat, int maxSizeX, int maxSizeY) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetStream
- an OutputStream for the target imagetargetFormat
- an ImageFormats object representing the target image
format, to which the original image should be
convertedmaxSizeX
- an int representing the maximum horizontal size;
as the aspect ratio is preserved, the actual size
might be lowermaxSizeY
- an int representing the maximum vertical size;
as the aspect ratio is preserved, the actual size
might be lowerpublic static void flipVertical(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void flipHorizontal(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void flipDiagonal(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void flipAntiDiagonal(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void rotate90(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void rotate180(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void rotate270(java.lang.String sourceURL, java.lang.String targetFile) throws java.io.IOException, PanamaException
sourceURL
- a String representing the URL of the original imagetargetFile
- a String representing the URL of the target BMP imagepublic static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |