|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.desy.acop.video.displayer.timage.TImageUtils
public class TImageUtils
Constructor Summary | |
---|---|
TImageUtils()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
addInsets(java.awt.image.BufferedImage src,
java.awt.Insets insets,
java.awt.Paint paint)
Add the insets to the image and fill span between image and new borders. |
static java.awt.image.BufferedImage |
bitmapToImage(byte[] data,
java.lang.String format)
Convert a bitmap to an Image object |
static de.desy.tine.types.IMAGE |
clone(de.desy.tine.types.IMAGE timage)
Deprecated. mdavid: use IMAGE.clone() instead |
static boolean |
compare(de.desy.tine.types.IMAGE cTImage,
de.desy.tine.types.IMAGE jTImage)
|
static java.awt.image.BufferedImage |
convertGrayByteToRGB(java.awt.image.BufferedImage image)
Convert 8 bit gray BufferedImage to RGB
BufferedImage . |
static java.awt.image.BufferedImage |
convertGrayShortToGrayByte(java.awt.image.BufferedImage image)
Convert 16 bit gray BufferedImage to 8 bit gray
BufferedImage . |
static java.awt.image.BufferedImage |
convertGrayShortToRGB(java.awt.image.BufferedImage srcImage)
Convert 16 bit gray BufferedImage to RGB
BufferedImage . |
static java.awt.image.BufferedImage |
convertToGrayscale(java.awt.image.BufferedImage source)
|
static java.awt.image.BufferedImage |
convertToGrayscale2(java.awt.image.BufferedImage colorImage)
|
static java.awt.Image |
convertToGrayscale3(java.awt.image.BufferedImage colorImage)
|
static byte[] |
getImageByteArray(java.awt.image.BufferedImage image)
Get a byte array associated with input buffered image. |
static java.awt.Image |
getImageFromArray(int[] pixels,
int width,
int height,
int type)
Creates an Image from array using raster. |
static int[] |
getImageIntArray(java.awt.image.BufferedImage image)
Get a integer array associated with input buffered image. |
static byte[] |
imageToBitmap(java.awt.image.BufferedImage image,
float resolution,
java.lang.String format)
Create an PNG image bitmap. |
static java.lang.String |
padString(java.lang.String s,
int n,
char c,
boolean padLeft)
Pad a string S with a size of N with char C on the left(True) or on the right(False) |
static java.awt.image.BufferedImage |
scale(java.awt.image.BufferedImage src,
int dstWidth,
int dstHeight,
boolean keepRatio)
|
static de.desy.tine.types.IMAGE |
setFrameHeader(de.desy.tine.types.IMAGE timage,
de.desy.tine.types.IMAGE.FrameHeader fraHeader)
TODO: should be replaced/changed into IMAGE.FrameHeader class |
static de.desy.tine.types.IMAGE |
setSourceHeader(de.desy.tine.types.IMAGE timage,
de.desy.tine.types.IMAGE.SourceHeader srcHeader)
TODO: should be replaced/changed into IMAGE.FrameHeader class |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image image)
Convenient static method to convert Image instances to BufferedImage instances. |
static java.awt.image.BufferedImage |
toColoredBufferedImage(java.awt.image.BufferedImage srcImage)
Converts image into colored buffered image. |
static java.awt.image.BufferedImage |
toIndexedBufferedImage(java.awt.image.BufferedImage srcImage,
java.awt.image.ColorModel icm)
Converts grayscale image into paletted (indexed) buffered image. |
static byte[] |
toRawBytes(java.awt.image.RenderedImage rimage,
java.lang.String formatName)
Writes an image using an arbitrary ImageWriter that supports the given format to a newly allocated byte array. |
static de.desy.tine.types.IMAGE |
uncompressImage(de.desy.tine.types.IMAGE timage)
Uncompresses the TINE image data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TImageUtils()
Method Detail |
---|
public static final java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
If the specified image is already instance of BufferedImage then it's returned without processing.
image
- - image to convert if it's necessary
java.lang.NullPointerException
- image
is nullpublic static final java.awt.image.BufferedImage addInsets(java.awt.image.BufferedImage src, java.awt.Insets insets, java.awt.Paint paint)
src
- - image to insetinsets
- - instance of Insets classpaint
- - to fill the span
java.lang.NullPointerException
- src
is null
insets
is nullpublic static final java.awt.image.BufferedImage scale(java.awt.image.BufferedImage src, int dstWidth, int dstHeight, boolean keepRatio)
src
- - image to scaledstWidth
- - width which source image should be minimized to (the result
image can have less width if 'keepRatio' parameter set to
true)dstHeight
- - height which source image should be minimized to (the result
image can have less height if 'keepRatio' parameter set to
true)keepRatio
- -resize image proportionally
java.lang.NullPointerException
- If src
is null
java.lang.IllegalArgumentException
- dstWidth
< 1
dstHeight
< 1public static byte[] toRawBytes(java.awt.image.RenderedImage rimage, java.lang.String formatName) throws java.io.IOException
rimage
- - a RenderedImage to be written.formatName
- - a String contain the informal name of the format.
java.io.IOException
- if an error occurs during writing.public static java.awt.Image getImageFromArray(int[] pixels, int width, int height, int type)
pixels
- - The input int pixel array.width
- - Width of the pixel rectangle.height
- - Height of the pixel rectangle.type
- - type of the created image
public static byte[] getImageByteArray(java.awt.image.BufferedImage image)
image
- - input buffered image
public static int[] getImageIntArray(java.awt.image.BufferedImage image)
image
- - input buffered image
public static byte[] imageToBitmap(java.awt.image.BufferedImage image, float resolution, java.lang.String format) throws java.io.IOException
image
- The image to render.resolution
- The DPI of the image.format
- The format to convert to.
java.io.IOException
public static java.awt.image.BufferedImage bitmapToImage(byte[] data, java.lang.String format) throws java.io.IOException
data
- The bitmap file.format
- The format the data is in.
java.io.IOException
- thrown if a problem reading the data or the format is wrong.public static java.awt.image.BufferedImage convertToGrayscale(java.awt.image.BufferedImage source)
public static java.awt.image.BufferedImage convertToGrayscale2(java.awt.image.BufferedImage colorImage)
public static java.awt.Image convertToGrayscale3(java.awt.image.BufferedImage colorImage)
public static de.desy.tine.types.IMAGE uncompressImage(de.desy.tine.types.IMAGE timage)
timage
- - input TINE IMAGE
public static final de.desy.tine.types.IMAGE clone(de.desy.tine.types.IMAGE timage)
IMAGE.clone()
instead
timage
TINE image.public static final de.desy.tine.types.IMAGE setFrameHeader(de.desy.tine.types.IMAGE timage, de.desy.tine.types.IMAGE.FrameHeader fraHeader)
public static final de.desy.tine.types.IMAGE setSourceHeader(de.desy.tine.types.IMAGE timage, de.desy.tine.types.IMAGE.SourceHeader srcHeader)
public static java.lang.String padString(java.lang.String s, int n, char c, boolean padLeft)
public static boolean compare(de.desy.tine.types.IMAGE cTImage, de.desy.tine.types.IMAGE jTImage)
public static java.awt.image.BufferedImage convertGrayByteToRGB(java.awt.image.BufferedImage image)
BufferedImage
to RGB
BufferedImage
.
image
- - source 8 bit gray BufferedImage
BufferedImage
public static java.awt.image.BufferedImage convertGrayShortToRGB(java.awt.image.BufferedImage srcImage)
BufferedImage
to RGB
BufferedImage
.
srcImage
- - source 16 bit gray BufferedImage
BufferedImage
public static java.awt.image.BufferedImage convertGrayShortToGrayByte(java.awt.image.BufferedImage image)
BufferedImage
to 8 bit gray
BufferedImage
.
image
- - source 16 bit gray BufferedImage
BufferedImage
public static java.awt.image.BufferedImage toIndexedBufferedImage(java.awt.image.BufferedImage srcImage, java.awt.image.ColorModel icm)
srcImage
- - grayscale buffered imageicm
- - indexed color model
public static java.awt.image.BufferedImage toColoredBufferedImage(java.awt.image.BufferedImage srcImage)
srcImage
- - buffered image
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |