Class ImageUtils

java.lang.Object
com.gaia3d.util.ImageUtils

public class ImageUtils extends Object
Utility class for image operations.
  • Constructor Details

    • ImageUtils

      public ImageUtils()
  • Method Details

    • getNearestPowerOfTwo

      public static int getNearestPowerOfTwo(int value)
    • getNearestPowerOfTwoHigher

      public static int getNearestPowerOfTwoHigher(int value)
    • getNearestPowerOfTwoLower

      public static int getNearestPowerOfTwoLower(int value)
    • setMinMaxSize

      public static int setMinMaxSize(int size)
    • getFormatNameByMimeType

      public static String getFormatNameByMimeType(String mimeType)
    • getMimeTypeByExtension

      public static String getMimeTypeByExtension(String extension)
    • readFile

      public static ByteBuffer readFile(File file, boolean flip)
    • getChildFile

      public static File getChildFile(File parent, String path)
    • correctFile

      public static File correctFile(File file)
    • correctPath

      public static File correctPath(File parent, File file) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • readImageSize

      public static int[] readImageSize(String imagePath)
    • unpackDepth32

      public static float unpackDepth32(float[] packedDepth)
    • bufferedImageToFloatMatrix

      public static float[][] bufferedImageToFloatMatrix(BufferedImage image)
    • invertImageY

      public static BufferedImage invertImageY(BufferedImage image)
    • clampBackGroundColor

      public static BufferedImage clampBackGroundColor(BufferedImage image, Color backGroundColor, int borderSize, int iterations)
    • changeBackgroundColor

      public static BufferedImage changeBackgroundColor(BufferedImage image, Color oldColor, Color newColor)
    • saveBufferedImage

      public static void saveBufferedImage(BufferedImage image, String format, String path)