Package zombie.core.textures
Class ImageData
java.lang.Object
zombie.core.textures.ImageData
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionthe data of imageint
static final int
-
Constructor Summary
ConstructorDescriptionImageData
(int width, int height) creates a new empty imageDataImageData
(int width, int height, WrappedBuffer data) ImageData
(BufferedInputStream b, boolean bDoMask, Texture.PZFileformat format) ImageData
(InputStream b, boolean bDoMask) ImageData
(TextureID texture, WrappedBuffer bb) -
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateNumMips
(int widthHW, int heightHW) static ImageData
createSteamAvatar
(long steamID) void
dispose()
getData()
int
int
int
getMipMapData
(int idx) static int
getNextMipDimension
(int dim) static int[]
getPixelClamped
(ByteBuffer dataBuff, int width, int height, int x, int y, int[] result) static int
getPixelDiscard
(ByteBuffer dataBuff, int width, int height, int x, int y, int[] result) int
getWidth()
int
void
boolean
isSolid()
void
makeTransp
(byte red, byte green, byte blue) make the image transparentvoid
makeTransp
(byte red, byte green, byte blue, byte alpha) make the image transparentvoid
setData
(BufferedImage image) void
static void
setPixel
(ByteBuffer dataBuff, int width, int height, int x, int y, int[] pixelRGBA)
-
Field Details
-
data
the data of image -
mask
-
id
public int id -
MIP_LEVEL_IDX_OFFSET
public static final int MIP_LEVEL_IDX_OFFSET- See Also:
-
-
Constructor Details
-
Method Details
-
createSteamAvatar
-
getData
-
makeTransp
public void makeTransp(byte red, byte green, byte blue) make the image transparent- Parameters:
red
- the red value (0-255)green
- the green value (0-255)blue
- the blue value (0-255)
-
makeTransp
public void makeTransp(byte red, byte green, byte blue, byte alpha) make the image transparent- Parameters:
red
- the red value (0-255)green
- the green value (0-255)blue
- the blue value (0-255)alpha
- the alpha value that will be setted (0-255)
-
setData
-
setData
-
getHeight
public int getHeight() -
getHeightHW
public int getHeightHW() -
isSolid
public boolean isSolid() -
getWidth
public int getWidth() -
getWidthHW
public int getWidthHW() -
getMipMapCount
public int getMipMapCount() -
getMipMapData
-
initMipMaps
public void initMipMaps() -
dispose
public void dispose() -
calculateNumMips
public static int calculateNumMips(int widthHW, int heightHW) -
getPixelDiscard
public static int getPixelDiscard(ByteBuffer dataBuff, int width, int height, int x, int y, int[] result) -
getPixelClamped
public static int[] getPixelClamped(ByteBuffer dataBuff, int width, int height, int x, int y, int[] result) -
setPixel
public static void setPixel(ByteBuffer dataBuff, int width, int height, int x, int y, int[] pixelRGBA) -
getNextMipDimension
public static int getNextMipDimension(int dim)
-