|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.render.ImageTemplate
public class ImageTemplate
The ImageTemplate
is a container for image data configured through a property.
You can get a scaled representation of the image or directly draw a scaled version to another image.
Constructor Summary | |
---|---|
ImageTemplate(java.lang.String name,
java.awt.image.BufferedImage bufferedImage)
|
Method Summary | |
---|---|
void |
drawScaled(int sx,
int sy,
int sw,
int sh,
int dx,
int dy,
int dw,
int dh,
TextureImage2D texture,
boolean clearBefore)
Draws a scaled representation of this image template to the given texture image. |
void |
drawScaled(int x,
int y,
int width,
int height,
TextureImage2D texture,
boolean clearBefore)
Draws a scaled representation of this image template to the given texture image. |
float |
getBaseAspect()
Gets the base aspect ratio of the image. |
int |
getBaseHeight()
Gets the base height of the image. |
int |
getBaseWidth()
Gets the base width of the image. |
java.lang.String |
getName()
Gets the image template's name. |
TextureImage2D |
getScaledTextureImage(int width,
int height,
boolean usePowerOfTwoSize)
Gets a scaled representation of this image template. |
TextureImage2D |
getScaledTextureImage(int width,
int height,
TextureImage2D possibleResult,
boolean tryToResize)
Gets a scaled representation of this image template. |
TransformableTexture |
getScaledTransformableTexture(int width,
int height,
boolean usePowerOfTwoSize)
Gets a TransformableTexture with this image drawn onto it. |
TransformableTexture |
getScaledTransformableTexture(int width,
int height,
TransformableTexture possibleResult,
boolean tryToResize)
Gets a TransformableTexture with this image drawn onto it. |
TransformableTexture |
getScaledTransformableTexture(int width,
int height,
TransformableTexture possibleResult,
boolean tryToResize,
boolean[] changeInfo)
Gets a TransformableTexture with this image drawn onto it. |
TextureImage2D |
getTextureImage()
Gets a representation of this image template. |
TransformableTexture |
getTransformableTexture()
Gets a TransformableTexture with this image drawn onto it using base size. |
boolean |
hasAlpha()
Gets, whether the image has an alpha channel or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageTemplate(java.lang.String name, java.awt.image.BufferedImage bufferedImage)
Method Detail |
---|
public final java.lang.String getName()
public final int getBaseWidth()
public final int getBaseHeight()
public final float getBaseAspect()
public final boolean hasAlpha()
public void drawScaled(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, TextureImage2D texture, boolean clearBefore)
sx
- source xsy
- source ysw
- source widthsh
- source heightdx
- destination xdy
- destination ydw
- destination widthdh
- destination heighttexture
- the texture to draw onclearBefore
- clear before drawing?public void drawScaled(int x, int y, int width, int height, TextureImage2D texture, boolean clearBefore)
x
- destination xy
- destination ywidth
- destination widthheight
- destination heighttexture
- the texture to draw onclearBefore
- clear before drawing?public TextureImage2D getScaledTextureImage(int width, int height, boolean usePowerOfTwoSize)
width
- destination widthheight
- destination heightusePowerOfTwoSize
- if true, the created texture is created with power of two width and height (with used size set to the desired values).
This is useful in editor mode avoid constant recreations.
public final TextureImage2D getScaledTextureImage(int width, int height, TextureImage2D possibleResult, boolean tryToResize)
width
- destination widthheight
- destination heightpossibleResult
- this instance is possibly returned, if parameters matchtryToResize
- if true, the passed in texture is resized to the given size, if the max size is sufficient.
This is useful in editor mode avoid constant recreations.
public final TextureImage2D getTextureImage()
public TransformableTexture getScaledTransformableTexture(int width, int height, boolean usePowerOfTwoSize)
TransformableTexture
with this image drawn onto it.
width
- destination widthheight
- destination heightusePowerOfTwoSize
- if true, the created texture is created with power of two width and height (with used size set to the desired values).
This is useful in editor mode to avoid constant recreations.
TransformableTexture
with this image drawn onto it.public TransformableTexture getScaledTransformableTexture(int width, int height, TransformableTexture possibleResult, boolean tryToResize, boolean[] changeInfo)
TransformableTexture
with this image drawn onto it.
If the possibleResult is non null and has the correct size, it is returned.
width
- destination widthheight
- destination heightpossibleResult
- this instance is possibly returned, if parameters matchtryToResize
- if true, the passed in texture is resized to the given size, if the max size is sufficient.
This is useful in editor mode avoid constant recreations.changeInfo
- if non null
the first element tells you, whether 'possibleResult' has been recycled and the second element, whether the texture has been (re)drawn
TransformableTexture
with this image drawn onto it.public TransformableTexture getScaledTransformableTexture(int width, int height, TransformableTexture possibleResult, boolean tryToResize)
TransformableTexture
with this image drawn onto it.
If the possibleResult is non null and has the correct size, it is returned.
width
- destination widthheight
- destination heightpossibleResult
- this instance is possibly returned, if parameters matchtryToResize
- if true, the passed in texture is resized to the given size, if the max size is sufficient.
This is useful in editor mode avoid constant recreations.
TransformableTexture
with this image drawn onto it.public TransformableTexture getTransformableTexture()
TransformableTexture
with this image drawn onto it using base size.
TransformableTexture
with this image drawn onto it.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |