Package zombie.core.utils
Class ImageUtils
java.lang.Object
zombie.core.utils.ImageUtils
class to simplify images management.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
depureTexture
(Texture texture, float limit) removes mistakes which are present on some ruined gif or png .
or problems you may have during the application of the blender-effect on images with transparents parts.static int
getNextPowerOfTwo
(int fold) get the closest greater power of 2 to the fold numberstatic int
getNextPowerOfTwoHW
(int fold) get the closest greater power of 2 to the fold number
This version check if the current computer's hardware support Not Power Of 2 texture: in this case this method will retourn the fold istead of the closest greater power of 2 value.static Texture
static ByteBuffer
makeTransp
(ByteBuffer data, int red, int green, int blue, int widthHW, int heightHW) static ByteBuffer
makeTransp
(ByteBuffer data, int red, int green, int blue, int alpha, int widthHW, int heightHW) static void
saveBmpImage
(Texture texture, String path) saves a texture on a bmp filestatic void
saves a texture on a image file
example: ImageUtils.saveImage( myTexture, "C:\image.png", "png" );static void
saveJpgImage
(Texture texture, String path) saves a texture on a jpg filestatic void
savePngImage
(Texture texture, String path) saves a texture on a png file
-
Field Details
-
USE_MIPMAP
public static boolean USE_MIPMAP
-
-
Method Details
-
depureTexture
removes mistakes which are present on some ruined gif or png .
or problems you may have during the application of the blender-effect on images with transparents parts.- Parameters:
texture
- source texturelimit
- a value [in range of 0:1] that indicates the depure
-
getNextPowerOfTwo
public static int getNextPowerOfTwo(int fold) get the closest greater power of 2 to the fold number- Parameters:
fold
- The target number- Returns:
- The power of 2
-
getNextPowerOfTwoHW
public static int getNextPowerOfTwoHW(int fold) get the closest greater power of 2 to the fold number
This version check if the current computer's hardware support Not Power Of 2 texture: in this case this method will retourn the fold istead of the closest greater power of 2 value.- Parameters:
fold
- The target number- Returns:
- The power of 2
-
getScreenShot
-
makeTransp
public static ByteBuffer makeTransp(ByteBuffer data, int red, int green, int blue, int widthHW, int heightHW) -
makeTransp
public static ByteBuffer makeTransp(ByteBuffer data, int red, int green, int blue, int alpha, int widthHW, int heightHW) -
saveBmpImage
saves a texture on a bmp file- Parameters:
texture
- the texture to savepath
- the file path
-
saveImage
saves a texture on a image file
example: ImageUtils.saveImage( myTexture, "C:\image.png", "png" );- Parameters:
texture
- the texture to savepath
- the file pathformat
- the type of image, for example: "bmp"
-
saveJpgImage
saves a texture on a jpg file- Parameters:
texture
- the texture to savepath
- the file path
-
savePngImage
saves a texture on a png file- Parameters:
texture
- the texture to savepath
- the file path
-