Package kr.toxicity.library.dynamicuv
Interface UVByteBuilder
public interface UVByteBuilder
A builder for creating byte arrays for UV assets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.GsonThe GSON instance used for JSON serialization. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]build()Builds the byte array.longGets the estimated size of the byte array.static @NotNull UVByteBuildernormalPixel(@NotNull UVNamespace namespace, @NotNull String textureName) Creates a UVByteBuilder for a normal pixel texture.static @NotNull UVByteBuilderCreates a UVByteBuilder from a JSON element.static @NotNull UVByteBuilderCreates a UVByteBuilder from a byte array supplier.static @NotNull UVByteBuilderof(@NotNull String path, @NotNull BufferedImage image) Creates a UVByteBuilder from a BufferedImage.@NotNull Stringpath()Gets the path of the asset.static @NotNull UVByteBuildertranslucentPixel(@NotNull UVNamespace namespace, @NotNull String textureName) Creates a UVByteBuilder for a translucent pixel texture.
-
Field Details
-
GSON
static final com.google.gson.Gson GSONThe GSON instance used for JSON serialization.
-
-
Method Details
-
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 namespacetextureName- 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 namespacetextureName- 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 assetestimatedSize- the estimated sizeelement- 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 assetimage- 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 assetestimatedSize- the estimated sizesupplier- the byte array supplier- Returns:
- the UVByteBuilder
-