Package com.gaia3d.util
Class ImageUtils
java.lang.Object
com.gaia3d.util.ImageUtils
Utility class for image operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float[][]static BufferedImagechangeBackgroundColor(BufferedImage image, Color oldColor, Color newColor) static BufferedImageclampBackGroundColor(BufferedImage image, Color backGroundColor, int borderSize, int iterations) static FilecorrectFile(File file) static BufferedImagecorrectGammaSaturation(BufferedImage src, double gamma, float saturationFactor) static BufferedImagecorrectGammaSaturation_original(BufferedImage src, double gamma, float saturationFactor) static FilecorrectPath(File parent, File file) static BufferedImageexpandWithBorderFast(BufferedImage src, int n, boolean bordeCopiado) static BufferedImagefillColor(BufferedImage image, Color newColor) static FilegetChildFile(File parent, String path) static StringgetChildPath(File parent, String path) static StringgetFormatNameByMimeType(String mimeType) static StringgetMimeTypeByExtension(String extension) static intgetNearestPowerOfTwo(int value) static intgetNearestPowerOfTwoHigher(int value) static intgetNearestPowerOfTwoLower(int value) static BufferedImageinvertImageY(BufferedImage image) static booleanstatic ByteBufferstatic int[]readImageSize(String imagePath) static booleansaveBufferedImage(BufferedImage bufferedImage, String savePath, boolean fastPng, float jpegQuality) static booleansaveBufferedImageControlled(BufferedImage image, String savePath, boolean fastPng, float jpegQuality) static intsetMinMaxSize(int size) static floatunpackDepth32(float[] packedDepth)
-
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
-
getMimeTypeByExtension
-
readFile
-
getChildFile
-
getChildPath
-
correctFile
-
correctPath
- Throws:
FileNotFoundException
-
readImageSize
-
unpackDepth32
public static float unpackDepth32(float[] packedDepth) -
bufferedImageToFloatMatrix
-
invertImageY
-
clampBackGroundColor
public static BufferedImage clampBackGroundColor(BufferedImage image, Color backGroundColor, int borderSize, int iterations) -
fillColor
-
changeBackgroundColor
public static BufferedImage changeBackgroundColor(BufferedImage image, Color oldColor, Color newColor) -
saveBufferedImage
public static boolean saveBufferedImage(BufferedImage bufferedImage, String savePath, boolean fastPng, float jpegQuality) - Parameters:
savePath- Ruta de destino.fastPng- true para priorizar velocidad sobre tamaƱo del PNG.jpegQuality- Calidad JPEG entre 0.0 y 1.0.- Returns:
- true cuando la imagen se escribió correctamente.
-
saveBufferedImageControlled
public static boolean saveBufferedImageControlled(BufferedImage image, String savePath, boolean fastPng, float jpegQuality) -
isImageFullyTransparent
-
correctGammaSaturation
public static BufferedImage correctGammaSaturation(BufferedImage src, double gamma, float saturationFactor) -
correctGammaSaturation_original
public static BufferedImage correctGammaSaturation_original(BufferedImage src, double gamma, float saturationFactor) -
expandWithBorderFast
-