Class ImageUtils

java.lang.Object
zombie.core.utils.ImageUtils

public class ImageUtils extends Object
class to simplify images management.
  • Field Details

    • USE_MIPMAP

      public static boolean USE_MIPMAP
  • Method Details

    • depureTexture

      public static void depureTexture(Texture texture, float limit)
      removes mistakes which are present on some ruined gif or png .
      Parameters:
      texture - source texture
      limit - 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
      Parameters:
      fold - The target number
      Returns:
      The power of 2
    • getScreenShot

      public static Texture 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

      public static void saveBmpImage(Texture texture, String path)
      saves a texture on a bmp file
      Parameters:
      texture - the texture to save
      path - the file path
    • saveImage

      public static void saveImage(Texture texture, String path, String format)
      saves a texture on a image file
      Parameters:
      texture - the texture to save
      path - the file path
      format - the type of image, for example: "bmp"
    • saveJpgImage

      public static void saveJpgImage(Texture texture, String path)
      saves a texture on a jpg file
      Parameters:
      texture - the texture to save
      path - the file path
    • savePngImage

      public static void savePngImage(Texture texture, String path)
      saves a texture on a png file
      Parameters:
      texture - the texture to save
      path - the file path