Package com.mojang.blaze3d.platform
Class TextureUtil
java.lang.Object
com.mojang.blaze3d.platform.TextureUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final org.slf4j.Loggerstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidbind(int textureId) static intstatic Pathstatic PathgetDebugTexturePath(Path basePath) static voidprepareImage(int textureId, int width, int height) static voidprepareImage(int textureId, int mipmapLevel, int width, int height) static voidprepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int width, int height) static voidprepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int mipmapLevel, int width, int height) static ByteBufferreadResource(InputStream inputStream) private static ByteBufferreadResource(ReadableByteChannel channel, int size) static voidreleaseTextureId(int textureId) static voidwriteAsPNG(Path outputDir, String textureName, int textureId, int amount, int width, int height) static voidwriteAsPNG(Path outputDir, String textureName, int textureId, int amount, int width, int height, IntUnaryOperator function)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MIN_MIPMAP_LEVEL
public static final int MIN_MIPMAP_LEVEL- See Also:
-
DEFAULT_IMAGE_BUFFER_SIZE
private static final int DEFAULT_IMAGE_BUFFER_SIZE- See Also:
-
-
Constructor Details
-
TextureUtil
public TextureUtil()
-
-
Method Details
-
generateTextureId
public static int generateTextureId() -
releaseTextureId
public static void releaseTextureId(int textureId) -
prepareImage
public static void prepareImage(int textureId, int width, int height) -
prepareImage
public static void prepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int width, int height) -
prepareImage
public static void prepareImage(int textureId, int mipmapLevel, int width, int height) -
prepareImage
public static void prepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int mipmapLevel, int width, int height) -
bind
private static void bind(int textureId) -
readResource
- Throws:
IOException
-
readResource
- Throws:
IOException
-
writeAsPNG
-
writeAsPNG
public static void writeAsPNG(Path outputDir, String textureName, int textureId, int amount, int width, int height, @Nullable IntUnaryOperator function) -
getDebugTexturePath
-
getDebugTexturePath
-