Package net.runelite.api
Interface SpritePixels
-
public interface SpritePixels
Represents data about the pixels of a sprite image.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SHADOW_COLOR
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
drawAt(int x, int y)
Draws the pixels at the given coordinates on the canvas.int
getHeight()
Gets the height of the sprite image in pixels.int
getMaxHeight()
Gets the max height of the sprite image in pixels.int
getMaxWidth()
Gets the max width of the sprite image in pixels.int
getOffsetX()
Gets the x offset of the sprite image in pixels.int
getOffsetY()
Gets the y offset of the sprite image in pixels.int[]
getPixels()
Gets an array of all pixels data in the sprite.int
getWidth()
Gets the width of the sprite image in pixels.void
setMaxHeight(int maxHeight)
Sets the max height of the sprite image in pixels.void
setMaxWidth(int maxWidth)
Sets the max width of the sprite image in pixels.void
setOffsetX(int offsetX)
Sets the x offset of the sprite image in pixels.void
setOffsetY(int offsetY)
Sets the y offset of the sprite image in pixels.BufferedImage
toBufferedImage()
Converts the sprite into a BufferedImage.void
toBufferedImage(BufferedImage img)
Writes the contents of the sprite to the given BufferedImage.BufferedImage
toBufferedOutline(Color color)
Writes the contents of the SpritePixels with chosen outline to the BufferedImagevoid
toBufferedOutline(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
-
-