Interface UVByteBuilder


public interface UVByteBuilder
A builder for creating byte arrays for UV assets.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.google.gson.Gson
    The GSON instance used for JSON serialization.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Builds the byte array.
    long
    Gets the estimated size of the byte array.
    static @NotNull UVByteBuilder
    normalPixel(@NotNull UVNamespace namespace, @NotNull String textureName)
    Creates a UVByteBuilder for a normal pixel texture.
    static @NotNull UVByteBuilder
    of(@NotNull String path, long estimatedSize, @NotNull com.google.gson.JsonElement element)
    Creates a UVByteBuilder from a JSON element.
    static @NotNull UVByteBuilder
    of(@NotNull String path, long estimatedSize, @NotNull Supplier<byte[]> supplier)
    Creates a UVByteBuilder from a byte array supplier.
    static @NotNull UVByteBuilder
    of(@NotNull String path, @NotNull BufferedImage image)
    Creates a UVByteBuilder from a BufferedImage.
    @NotNull String
    Gets the path of the asset.
    static @NotNull UVByteBuilder
    translucentPixel(@NotNull UVNamespace namespace, @NotNull String textureName)
    Creates a UVByteBuilder for a translucent pixel texture.
  • Field Details

    • GSON

      static final com.google.gson.Gson GSON
      The GSON instance used for JSON serialization.
  • Method Details

    • path

      @NotNull @NotNull String path()
      Gets the path of the asset.
      Returns:
      the path
    • build

      byte[] build()
      Builds the byte array.
      Returns:
      the byte array
    • estimatedSize

      long estimatedSize()
      Gets the estimated size of the byte array.
      Returns:
      the estimated size
    • normalPixel

      @NotNull static @NotNull UVByteBuilder normalPixel(@NotNull @NotNull UVNamespace namespace, @NotNull @NotNull String textureName)
      Creates a UVByteBuilder for a normal pixel texture.
      Parameters:
      namespace - the UV namespace
      textureName - the texture name
      Returns:
      the UVByteBuilder
    • translucentPixel

      @NotNull static @NotNull UVByteBuilder translucentPixel(@NotNull @NotNull UVNamespace namespace, @NotNull @NotNull String textureName)
      Creates a UVByteBuilder for a translucent pixel texture.
      Parameters:
      namespace - the UV namespace
      textureName - the texture name
      Returns:
      the UVByteBuilder
    • of

      @NotNull static @NotNull UVByteBuilder of(@NotNull @NotNull String path, long estimatedSize, @NotNull @NotNull com.google.gson.JsonElement element)
      Creates a UVByteBuilder from a JSON element.
      Parameters:
      path - the path of the asset
      estimatedSize - the estimated size
      element - the JSON element
      Returns:
      the UVByteBuilder
    • of

      @NotNull static @NotNull UVByteBuilder of(@NotNull @NotNull String path, @NotNull @NotNull BufferedImage image)
      Creates a UVByteBuilder from a BufferedImage.
      Parameters:
      path - the path of the asset
      image - the image
      Returns:
      the UVByteBuilder
    • of

      @NotNull static @NotNull UVByteBuilder of(@NotNull @NotNull String path, long estimatedSize, @NotNull @NotNull Supplier<byte[]> supplier)
      Creates a UVByteBuilder from a byte array supplier.
      Parameters:
      path - the path of the asset
      estimatedSize - the estimated size
      supplier - the byte array supplier
      Returns:
      the UVByteBuilder