public final class ToolsSwt extends Object
Modifier and Type | Method and Description |
---|---|
static org.eclipse.swt.graphics.Image |
applyMask(org.eclipse.swt.graphics.Image image,
int maskColor)
Apply color mask to the image.
|
static org.eclipse.swt.graphics.Cursor |
createHiddenCursor(org.eclipse.swt.graphics.Device device)
Create a hidden cursor.
|
static org.eclipse.swt.graphics.Image |
createImage(int width,
int height,
int transparency)
Create an image.
|
static org.eclipse.swt.graphics.Image |
flip(org.eclipse.swt.graphics.Image image,
boolean vertical)
Flip an image depending of the axis.
|
static org.eclipse.swt.graphics.Image |
flipHorizontal(org.eclipse.swt.graphics.Image image)
Apply an horizontal flip to the input image.
|
static org.eclipse.swt.graphics.Image |
flipVertical(org.eclipse.swt.graphics.Image image)
Apply a vertical flip to the input image.
|
static org.eclipse.swt.widgets.Display |
getDisplay()
Get a unique display for the thread caller.
|
static org.eclipse.swt.graphics.Image |
getImage(org.eclipse.swt.graphics.Device device,
InputStream input)
Get an image from an image file.
|
static org.eclipse.swt.graphics.Image |
getImage(org.eclipse.swt.graphics.Image image)
Get an image from an image.
|
static org.eclipse.swt.graphics.ImageData |
getImageData(InputStream input)
Get an image data from an image file.
|
static org.eclipse.swt.graphics.Image |
getRasterBuffer(org.eclipse.swt.graphics.Image image,
int fr,
int fg,
int fb,
int er,
int eg,
int eb,
int refSize)
Get raster buffer from data.
|
static int |
getTransparency(com.b3dgs.lionengine.graphic.Transparency transparency)
Get the image transparency equivalence.
|
static org.eclipse.swt.graphics.Image |
resize(org.eclipse.swt.graphics.Image image,
int width,
int height)
Resize input image.
|
static org.eclipse.swt.graphics.Image |
rotate(org.eclipse.swt.graphics.Image image,
int angle)
Rotate input image.
|
static void |
saveImage(org.eclipse.swt.graphics.Image image,
OutputStream output)
Save an image into a file.
|
static org.eclipse.swt.graphics.Image[] |
splitImage(org.eclipse.swt.graphics.Image image,
int h,
int v)
Split an image into an array of sub image.
|
public static org.eclipse.swt.widgets.Display getDisplay()
public static org.eclipse.swt.graphics.Image createImage(int width, int height, int transparency)
width
- The image width.height
- The image height.transparency
- The image transparency.org.eclipse.swt.SWTException
- If error on getting data.public static int getTransparency(com.b3dgs.lionengine.graphic.Transparency transparency)
transparency
- The transparency type.public static org.eclipse.swt.graphics.Cursor createHiddenCursor(org.eclipse.swt.graphics.Device device)
device
- The device reference.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.ImageData getImageData(InputStream input)
input
- The image input stream.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image getImage(org.eclipse.swt.graphics.Device device, InputStream input)
device
- The device reference.input
- The image input stream.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image getImage(org.eclipse.swt.graphics.Image image)
image
- The image.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image applyMask(org.eclipse.swt.graphics.Image image, int maskColor)
image
- The image reference.maskColor
- The color mask.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image[] splitImage(org.eclipse.swt.graphics.Image image, int h, int v)
image
- The image to split.h
- The number of horizontal divisions (strictly positive).v
- The number of vertical divisions (strictly positive).org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image rotate(org.eclipse.swt.graphics.Image image, int angle)
image
- The input image.angle
- The angle to apply in degree (0-359).org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image resize(org.eclipse.swt.graphics.Image image, int width, int height)
image
- The input image.width
- The new width.height
- The new height.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image flip(org.eclipse.swt.graphics.Image image, boolean vertical)
image
- The image source.vertical
- true
if vertical, false
if horizontal.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image flipHorizontal(org.eclipse.swt.graphics.Image image)
image
- The input image.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image flipVertical(org.eclipse.swt.graphics.Image image)
image
- The input image.org.eclipse.swt.SWTException
- If error on getting data.public static void saveImage(org.eclipse.swt.graphics.Image image, OutputStream output)
image
- The image to save.output
- The output stream.org.eclipse.swt.SWTException
- If error on getting data.public static org.eclipse.swt.graphics.Image getRasterBuffer(org.eclipse.swt.graphics.Image image, int fr, int fg, int fb, int er, int eg, int eb, int refSize)
image
- The image.fr
- The first red.fg
- The first green.fb
- The first blue.er
- The end red.eg
- The end green.eb
- The end blue.refSize
- The reference size.org.eclipse.swt.SWTException
- If error on getting data.Copyright © 2016 Byron 3D Games Studio. All rights reserved.