public final class ToolsAwt extends Object
Modifier and Type | Method and Description |
---|---|
static BufferedImage |
applyMask(BufferedImage image,
int rgba)
Apply a mask to an existing image.
|
static BufferedImage |
copyImage(BufferedImage image)
Create an image.
|
static void |
createBufferStrategy(Canvas component,
GraphicsConfiguration conf)
Create the buffer strategy using default capabilities.
|
static void |
createBufferStrategy(Window component,
GraphicsConfiguration conf)
Create the buffer strategy using default capabilities.
|
static Cursor |
createHiddenCursor()
Create a hidden cursor.
|
static BufferedImage |
createImage(int width,
int height,
int transparency)
Create an image.
|
static BufferedImage |
flipHorizontal(BufferedImage image)
Apply an horizontal flip to the input image.
|
static BufferedImage |
flipVertical(BufferedImage image)
Apply a vertical flip to the input image.
|
static BufferedImage |
getImage(InputStream input)
Get an image from an input stream.
|
static ImageBuffer |
getImageBuffer(BufferedImage image)
Create an image.
|
static int[] |
getImageData(BufferedImage image)
Get the image pixels data.
|
static BufferedImage |
getRasterBuffer(BufferedImage image,
int fr,
int fg,
int fb,
int er,
int eg,
int eb,
int size)
Get raster buffer from data.
|
static int |
getTransparency(Transparency transparency)
Get the image transparency equivalence.
|
static void |
optimizeGraphicsQuality(Graphics2D g)
Enable all graphics improvement.
|
static void |
optimizeGraphicsSpeed(Graphics2D g)
Disable all graphics improvement.
|
static BufferedImage |
resize(BufferedImage image,
int width,
int height)
Resize input image buffer.
|
static BufferedImage |
rotate(BufferedImage image,
int angle)
Rotate an image with an angle in degree.
|
static void |
saveImage(BufferedImage image,
OutputStream output)
Save image to output stream.
|
static BufferedImage[] |
splitImage(BufferedImage image,
int h,
int v)
Split an image into an array of sub image.
|
public static int getTransparency(Transparency transparency)
transparency
- The transparency type.public static BufferedImage createImage(int width, int height, int transparency)
width
- The image width.height
- The image height.transparency
- The image transparency.LionEngineException
- If negative size.public static BufferedImage getImage(InputStream input) throws IOException
input
- The image input stream.IOException
- If error when reading image.public static ImageBuffer getImageBuffer(BufferedImage image)
image
- The image.public static void saveImage(BufferedImage image, OutputStream output) throws IOException
image
- The image to save.output
- The output stream.IOException
- If error when saving image.public static BufferedImage copyImage(BufferedImage image)
image
- The image reference.public static int[] getImageData(BufferedImage image)
image
- The image reference.public static BufferedImage applyMask(BufferedImage image, int rgba)
image
- The existing image.rgba
- The rgba color value.public static BufferedImage rotate(BufferedImage image, int angle)
image
- The input image.angle
- The angle in degree to apply.public static BufferedImage resize(BufferedImage image, int width, int height)
image
- The input image buffer.width
- The new width.height
- The new height.public static BufferedImage flipHorizontal(BufferedImage image)
image
- The input image buffer.public static BufferedImage flipVertical(BufferedImage image)
image
- The input image buffer.public static BufferedImage[] splitImage(BufferedImage 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).public static BufferedImage getRasterBuffer(BufferedImage image, int fr, int fg, int fb, int er, int eg, int eb, int size)
image
- The image buffer.fr
- The first red.fg
- The first green.fb
- The first blue.er
- The end red.eg
- The end green.eb
- The end blue.size
- The reference size.public static Cursor createHiddenCursor()
public static void createBufferStrategy(Canvas component, GraphicsConfiguration conf)
component
- The component reference.conf
- The current configuration.public static void createBufferStrategy(Window component, GraphicsConfiguration conf)
component
- The component reference.conf
- The current configuration.public static void optimizeGraphicsQuality(Graphics2D g)
g
- The graphic context.public static void optimizeGraphicsSpeed(Graphics2D g)
g
- The graphic context.Copyright © 2017 Byron 3D Games Studio. All rights reserved.