Package net.runelite.api
Interface SpritePixels
-
public interface SpritePixelsRepresents data about the pixels of a sprite image.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SHADOW_COLOR
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddrawAt(int x, int y)Draws the pixels at the given coordinates on the canvas.intgetHeight()Gets the height of the sprite image in pixels.intgetMaxHeight()Gets the max height of the sprite image in pixels.intgetMaxWidth()Gets the max width of the sprite image in pixels.intgetOffsetX()Gets the x offset of the sprite image in pixels.intgetOffsetY()Gets the y offset of the sprite image in pixels.int[]getPixels()Gets an array of all pixels data in the sprite.intgetWidth()Gets the width of the sprite image in pixels.voidsetMaxHeight(int maxHeight)Sets the max height of the sprite image in pixels.voidsetMaxWidth(int maxWidth)Sets the max width of the sprite image in pixels.voidsetOffsetX(int offsetX)Sets the x offset of the sprite image in pixels.voidsetOffsetY(int offsetY)Sets the y offset of the sprite image in pixels.BufferedImagetoBufferedImage()Converts the sprite into a BufferedImage.voidtoBufferedImage(BufferedImage img)Writes the contents of the sprite to the given BufferedImage.BufferedImagetoBufferedOutline(Color color)Writes the contents of the SpritePixels with chosen outline to the BufferedImagevoidtoBufferedOutline(BufferedImage img, int color)Writes the contents of the SpritePixels with chosen outline to the BufferedImage
-
-
-
Field Detail
-
DEFAULT_SHADOW_COLOR
static final int DEFAULT_SHADOW_COLOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
drawAt
void drawAt(int x, int y)Draws the pixels at the given coordinates on the canvas.- Parameters:
x- the x-axis coordinatey- the y-axis coordinate
-
getWidth
int getWidth()
Gets the width of the sprite image in pixels.- Returns:
- the width
-
getHeight
int getHeight()
Gets the height of the sprite image in pixels.- Returns:
- the height
-
getMaxWidth
int getMaxWidth()
Gets the max width of the sprite image in pixels.- Returns:
- the width
-
getMaxHeight
int getMaxHeight()
Gets the max height of the sprite image in pixels.- Returns:
- the height
-
getOffsetX
int getOffsetX()
Gets the x offset of the sprite image in pixels.- Returns:
- the offset
-
getOffsetY
int getOffsetY()
Gets the y offset of the sprite image in pixels.- Returns:
- the offset
-
setMaxWidth
void setMaxWidth(int maxWidth)
Sets the max width of the sprite image in pixels.- Parameters:
maxWidth- the width
-
setMaxHeight
void setMaxHeight(int maxHeight)
Sets the max height of the sprite image in pixels.- Parameters:
maxHeight- the height
-
setOffsetX
void setOffsetX(int offsetX)
Sets the x offset of the sprite image in pixels.- Parameters:
offsetX- the offset
-
setOffsetY
void setOffsetY(int offsetY)
Sets the y offset of the sprite image in pixels.- Parameters:
offsetY- the offset
-
getPixels
int[] getPixels()
Gets an array of all pixels data in the sprite.- Returns:
- the pixel data
-
toBufferedImage
BufferedImage toBufferedImage()
Converts the sprite into a BufferedImage.- Returns:
- the resulting BufferedImage
-
toBufferedImage
void toBufferedImage(BufferedImage img) throws IllegalArgumentException
Writes the contents of the sprite to the given BufferedImage.- Parameters:
img- the passsed buffered image- Throws:
IllegalArgumentException- if the width or height do not match
-
toBufferedOutline
BufferedImage toBufferedOutline(Color color)
Writes the contents of the SpritePixels with chosen outline to the BufferedImage- Parameters:
color- target color
-
toBufferedOutline
void toBufferedOutline(BufferedImage img, int color)
Writes the contents of the SpritePixels with chosen outline to the BufferedImage- Parameters:
img- target imagecolor- target color
-
-