Class GaiaTexture

All Implemented Interfaces:
Serializable

public class GaiaTexture extends TextureStructure implements Serializable
A class that represents a texture of a Gaia object. It contains the texture name, path, type, width, height, format, byteLength, and byteBuffer. The byteBuffer is used to create a texture. The byteBuffer is created by reading the texture file.
See Also:
  • Constructor Details

    • GaiaTexture

      public GaiaTexture()
  • Method Details

    • loadImage

      public void loadImage()
    • hasBufferedImage

      public boolean hasBufferedImage()
    • deleteBufferedImage

      public void deleteBufferedImage()
    • readImageScaled

      public BufferedImage readImageScaled(Path imagePath, int dimensionLimit) throws IOException
      Throws:
      IOException
    • saveImage

      public void saveImage(String savePath)
    • saveImage

      public boolean saveImage(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.
    • flipImageY

      public void flipImageY()
    • getFullPath

      public String getFullPath()
    • createImage

      public void createImage(int width, int height, int imageType)
    • fillImage

      public void fillImage(Color color)
    • loadImage

      public void loadImage(LevelOfDetail lod)
    • resizeImage

      public void resizeImage(int width, int height)
    • getPureBufferedImage

      public BufferedImage getPureBufferedImage()
    • getBufferedImage

      public BufferedImage getBufferedImage()
    • getBufferedImage

      public BufferedImage getBufferedImage(LevelOfDetail lod)
    • deleteObjects

      public void deleteObjects()
    • isEqualTexture

      public boolean isEqualTexture(GaiaTexture compareTexture)
      It's a slow comparison of two textures, but it's accurate.
    • compareFileBytes

      public boolean compareFileBytes(GaiaTexture a, GaiaTexture b)
    • isEqualTexture

      public boolean isEqualTexture(GaiaTexture compareTexture, LevelOfDetail lod)
    • clear

      public void clear()
    • clone

      public GaiaTexture clone()