public final class Graphics extends Object
FactoryGraphic
.
This class is Thread-Safe.
Modifier and Type | Method and Description |
---|---|
static ImageBuffer |
applyMask(ImageBuffer imageBuffer,
ColorRgba maskColor)
Apply color mask to the image.
|
static Graphic |
createGraphic()
Create a graphic context.
|
static ImageBuffer |
createImageBuffer(int width,
int height,
Transparency transparency)
Create an image buffer.
|
static Screen |
createScreen(Config config)
Create a screen.
|
static Text |
createText(String fontName,
int size,
TextStyle style)
Crate a text.
|
static Transform |
createTransform()
Create a transform.
|
static ImageBuffer |
flipHorizontal(ImageBuffer image)
Apply an horizontal flip to the input image.
|
static ImageBuffer |
flipVertical(ImageBuffer image)
Apply a vertical flip to the input image.
|
static ImageBuffer |
getImageBuffer(ImageBuffer imageBuffer)
Get an image buffer from an image buffer.
|
static ImageBuffer |
getImageBuffer(Media media)
Get an image buffer from an image file.
|
static ImageBuffer |
getRasterBuffer(ImageBuffer img,
int fr,
int fg,
int fb,
int er,
int eg,
int eb,
int size)
Get raster buffer from data.
|
static ImageBuffer |
resize(ImageBuffer image,
int width,
int height)
Resize input image buffer.
|
static ImageBuffer |
rotate(ImageBuffer image,
int angle)
Rotate input image buffer.
|
static void |
saveImage(ImageBuffer image,
Media media)
Save an image into a file.
|
static void |
setFactoryGraphic(FactoryGraphic factoryGraphic)
Set the graphic factory used.
|
static ImageBuffer[] |
splitImage(ImageBuffer image,
int h,
int v)
Split an image into an array of sub image.
|
public static void setFactoryGraphic(FactoryGraphic factoryGraphic)
factoryGraphic
- The graphic factory used.public static Screen createScreen(Config config)
config
- The config reference.public static Graphic createGraphic()
public static Transform createTransform()
public static Text createText(String fontName, int size, TextStyle style)
fontName
- The font name.size
- The font size (in pixel).style
- The font style.public static ImageBuffer createImageBuffer(int width, int height, Transparency transparency)
width
- The image width.height
- The image height.transparency
- The image transparency.public static ImageBuffer getImageBuffer(Media media)
media
- The image media.LionEngineException
- If an error occurred when reading the image.public static ImageBuffer getImageBuffer(ImageBuffer imageBuffer)
imageBuffer
- The image buffer.public static ImageBuffer applyMask(ImageBuffer imageBuffer, ColorRgba maskColor)
imageBuffer
- The image reference.maskColor
- The color mask.public static ImageBuffer[] splitImage(ImageBuffer 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 ImageBuffer rotate(ImageBuffer image, int angle)
image
- The input image buffer.angle
- The angle to apply in degree (0-359)public static ImageBuffer resize(ImageBuffer image, int width, int height)
image
- The input image buffer.width
- The new width.height
- The new height.public static ImageBuffer flipHorizontal(ImageBuffer image)
image
- The input image buffer.public static ImageBuffer flipVertical(ImageBuffer image)
image
- The input image buffer.public static void saveImage(ImageBuffer image, Media media)
image
- The image to save.media
- The output media.LionEngineException
- If an error occurred when saving the image.public static ImageBuffer getRasterBuffer(ImageBuffer img, int fr, int fg, int fb, int er, int eg, int eb, int size)
img
- 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.Copyright © 2016 Byron 3D Games Studio. All rights reserved.