public class VectorImage
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
VectorImage |
filterImage(float[] colorMatrix)
Creates an image derived from this image, applying the given color matrix.
|
long |
getDuration()
Gets the duration of the vector image animation if the image is animated, otherwise 0.
|
float |
getHeight()
Gets the height of the vector image.
|
static VectorImage |
getImage(java.lang.String resourcePath)
Gets a vector image from a path.
|
float |
getWidth()
Gets the width of the vector image.
|
public static VectorImage getImage(java.lang.String resourcePath)
resourcePath
- the path to get the image fromVectorGraphicsException
- if the image could not be retrieved for any reason (see
VectorGraphicsException.getErrorCode()
)public VectorImage filterImage(float[] colorMatrix)
redMultiplier x redInitialComponent + greenMultiplier x greenInitialComponent + blueMultiplier x blueInitialComponent + constant
Each component is clamped between 0x0 and 0xff.
Let A, R, G, B be the components of the initial color and the following array a color matrix:
{ rR, rG, rB, rA, rC,
gR, gG, gB, gA, gC,
bR, bG, bB, bA, bC,
aR, aG, aB, aA, aC }
The resulting color components are computed as:
resultRed = rR * R + rG * G + rB * B + rA * A + rC resultGreen = gR * R + gG * G + gB * B + gA * A + gC resultBlue = bR * R + bG * G + bB * B + bA * A + bC resultAlpha = aR * R + aG * G + aB * B + aA * A + aC
colorMatrix
- the color matrix used to transform colorsjava.lang.ArrayIndexOutOfBoundsException
- if the given color matrix is shorter than 20 entriesVectorGraphicsException
- if the image has overlapping paths and the color matrix puts a non-opaque alpha level (see
VectorGraphicsException.getErrorCode()
)public float getWidth()
public float getHeight()
public long getDuration()