Package com.mojang.blaze3d.platform
Class TextureUtil
java.lang.Object
com.mojang.blaze3d.platform.TextureUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final org.slf4j.Logger
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
bind
(int textureId) static int
static Path
static Path
getDebugTexturePath
(Path basePath) static void
prepareImage
(int textureId, int width, int height) static void
prepareImage
(int textureId, int mipmapLevel, int width, int height) static void
prepareImage
(NativeImage.InternalGlFormat pixelFormat, int textureId, int width, int height) static void
prepareImage
(NativeImage.InternalGlFormat pixelFormat, int textureId, int mipmapLevel, int width, int height) static ByteBuffer
readResource
(InputStream inputStream) private static ByteBuffer
readResource
(ReadableByteChannel channel, int size) static void
releaseTextureId
(int textureId) static void
writeAsPNG
(Path outputDir, String textureName, int textureId, int amount, int width, int height) static void
writeAsPNG
(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
-