Package net.minecraft.client.texture
Class NativeImage
java.lang.Object
net.minecraft.client.texture.NativeImage
- All Implemented Interfaces:
AutoCloseable
- Mappings:
Namespace Name intermediary net/minecraft/class_1011official ehcnamed net/minecraft/client/texture/NativeImage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumRepresents the internal formats sent toglTexImage2D, representing the number of color channels present in an image to prepare.private static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NativeImage.Formatprivate final intprivate final booleanprivate static final Loggerprivate longprivate final longprivate final intprivate static final Set<StandardOpenOption> -
Constructor Summary
ConstructorsModifierConstructorDescriptionNativeImage(int width, int height, boolean useStb) NativeImage(NativeImage.Format format, int width, int height, boolean useStb) privateNativeImage(NativeImage.Format format, int width, int height, boolean useStb, long pointer) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(IntUnaryOperator operator) applyToCopy(IntUnaryOperator operator) voidblend(int x, int y, int color) private voidvoidclose()voidcopyFrom(NativeImage image) int[]voidcopyRect(int x, int y, int translateX, int translateY, int width, int height, boolean flipX, boolean flipY) voidcopyRect(NativeImage image, int x, int y, int destX, int destY, int width, int height, boolean flipX, boolean flipY) voidUseuploadto upload this image to GL so it can be used later.voidfillRect(int x, int y, int width, int height, int color) bytegetBlue(int x, int y) byte[]getBytes()intgetColor(int x, int y) Gets the color of a pixel on this native image.bytegetGreen(int x, int y) intbytegetOpacity(int x, int y) bytegetRed(int x, int y) intgetWidth()private booleanisOutOfBounds(int x, int y) voidloadFromTextureImage(int level, boolean removeAlpha) voidmakeGlyphBitmapSubpixel(STBTTFontinfo fontInfo, int glyphIndex, int width, int height, float scaleX, float scaleY, float shiftX, float shiftY, int startX, int startY) int[]Deprecated.voidstatic NativeImageread(byte[] bytes) static NativeImageread(InputStream stream) static NativeImageread(ByteBuffer buffer) static NativeImageread(@Nullable NativeImage.Format format, InputStream stream) static NativeImageread(@Nullable NativeImage.Format format, ByteBuffer buffer) voidreadDepthComponent(float unused) voidresizeSubRectTo(int x, int y, int width, int height, NativeImage targetImage) voidsetColor(int x, int y, int color) Sets the color of a pixel on this native image.voidsetLuminance(int x, int y, byte luminance) private static voidsetTextureFilter(boolean blur, boolean mipmap) toString()voiduntrack()voidupload(int level, int offsetX, int offsetY, boolean close) voidupload(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean mipmap, boolean close) voidupload(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean close) private voiduploadInternal(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean close) private booleanwrite(WritableByteChannel channel) voidvoid
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector intermediary field_21684Lnet/minecraft/class_1011;field_21684:Lorg/slf4j/Logger;official aLehc;a:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/client/texture/NativeImage;LOGGER:Lorg/slf4j/Logger;
-
WRITE_TO_FILE_OPEN_OPTIONS
- Mappings:
Namespace Name Mixin selector intermediary field_4992Lnet/minecraft/class_1011;field_4992:Ljava/util/Set;official bLehc;b:Ljava/util/Set;named WRITE_TO_FILE_OPEN_OPTIONSLnet/minecraft/client/texture/NativeImage;WRITE_TO_FILE_OPEN_OPTIONS:Ljava/util/Set;
-
format
- Mappings:
Namespace Name Mixin selector intermediary field_4986Lnet/minecraft/class_1011;field_4986:Lnet/minecraft/class_1011$class_1012;official cLehc;c:Lehc$a;named formatLnet/minecraft/client/texture/NativeImage;format:Lnet/minecraft/client/texture/NativeImage$Format;
-
width
private final int width- Mappings:
Namespace Name Mixin selector intermediary field_4991Lnet/minecraft/class_1011;field_4991:Iofficial dLehc;d:Inamed widthLnet/minecraft/client/texture/NativeImage;width:I
-
height
private final int height- Mappings:
Namespace Name Mixin selector intermediary field_4989Lnet/minecraft/class_1011;field_4989:Iofficial eLehc;e:Inamed heightLnet/minecraft/client/texture/NativeImage;height:I
-
isStbImage
private final boolean isStbImage- Mappings:
Namespace Name Mixin selector intermediary field_4990Lnet/minecraft/class_1011;field_4990:Zofficial fLehc;f:Znamed isStbImageLnet/minecraft/client/texture/NativeImage;isStbImage:Z
-
pointer
private long pointer- Mappings:
Namespace Name Mixin selector intermediary field_4988Lnet/minecraft/class_1011;field_4988:Jofficial gLehc;g:Jnamed pointerLnet/minecraft/client/texture/NativeImage;pointer:J
-
sizeBytes
private final long sizeBytes- Mappings:
Namespace Name Mixin selector intermediary field_4987Lnet/minecraft/class_1011;field_4987:Jofficial hLehc;h:Jnamed sizeBytesLnet/minecraft/client/texture/NativeImage;sizeBytes:J
-
-
Constructor Details
-
NativeImage
public NativeImage(int width, int height, boolean useStb) - Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_1011;<init>(IIZ)Vofficial <init>Lehc;<init>(IIZ)Vnamed <init>Lnet/minecraft/client/texture/NativeImage;<init>(IIZ)V
-
NativeImage
- Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_1011;<init>(Lnet/minecraft/class_1011$class_1012;IIZ)Vofficial <init>Lehc;<init>(Lehc$a;IIZ)Vnamed <init>Lnet/minecraft/client/texture/NativeImage;<init>(Lnet/minecraft/client/texture/NativeImage$Format;IIZ)V
-
NativeImage
- Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_1011;<init>(Lnet/minecraft/class_1011$class_1012;IIZJ)Vofficial <init>Lehc;<init>(Lehc$a;IIZJ)Vnamed <init>Lnet/minecraft/client/texture/NativeImage;<init>(Lnet/minecraft/client/texture/NativeImage$Format;IIZJ)V
-
-
Method Details
-
toString
-
isOutOfBounds
private boolean isOutOfBounds(int x, int y) - Mappings:
Namespace Name Mixin selector intermediary method_36559Lnet/minecraft/class_1011;method_36559(II)Zofficial fLehc;f(II)Znamed isOutOfBoundsLnet/minecraft/client/texture/NativeImage;isOutOfBounds(II)Z
-
read
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4309Lnet/minecraft/class_1011;method_4309(Ljava/io/InputStream;)Lnet/minecraft/class_1011;official aLehc;a(Ljava/io/InputStream;)Lehc;named readLnet/minecraft/client/texture/NativeImage;read(Ljava/io/InputStream;)Lnet/minecraft/client/texture/NativeImage;
-
read
public static NativeImage read(@Nullable @Nullable NativeImage.Format format, InputStream stream) throws IOException - Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4310Lnet/minecraft/class_1011;method_4310(Lnet/minecraft/class_1011$class_1012;Ljava/io/InputStream;)Lnet/minecraft/class_1011;official aLehc;a(Lehc$a;Ljava/io/InputStream;)Lehc;named readLnet/minecraft/client/texture/NativeImage;read(Lnet/minecraft/client/texture/NativeImage$Format;Ljava/io/InputStream;)Lnet/minecraft/client/texture/NativeImage;
-
read
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4324Lnet/minecraft/class_1011;method_4324(Ljava/nio/ByteBuffer;)Lnet/minecraft/class_1011;official aLehc;a(Ljava/nio/ByteBuffer;)Lehc;named readLnet/minecraft/client/texture/NativeImage;read(Ljava/nio/ByteBuffer;)Lnet/minecraft/client/texture/NativeImage;
-
read
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_49277Lnet/minecraft/class_1011;method_49277([B)Lnet/minecraft/class_1011;official aLehc;a([B)Lehc;named readLnet/minecraft/client/texture/NativeImage;read([B)Lnet/minecraft/client/texture/NativeImage;
-
read
public static NativeImage read(@Nullable @Nullable NativeImage.Format format, ByteBuffer buffer) throws IOException - Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4303Lnet/minecraft/class_1011;method_4303(Lnet/minecraft/class_1011$class_1012;Ljava/nio/ByteBuffer;)Lnet/minecraft/class_1011;official aLehc;a(Lehc$a;Ljava/nio/ByteBuffer;)Lehc;named readLnet/minecraft/client/texture/NativeImage;read(Lnet/minecraft/client/texture/NativeImage$Format;Ljava/nio/ByteBuffer;)Lnet/minecraft/client/texture/NativeImage;
-
setTextureFilter
private static void setTextureFilter(boolean blur, boolean mipmap) - Mappings:
Namespace Name Mixin selector intermediary method_4308Lnet/minecraft/class_1011;method_4308(ZZ)Vofficial aLehc;a(ZZ)Vnamed setTextureFilterLnet/minecraft/client/texture/NativeImage;setTextureFilter(ZZ)V
-
checkAllocated
private void checkAllocated()- Mappings:
Namespace Name Mixin selector intermediary method_4320Lnet/minecraft/class_1011;method_4320()Vofficial jLehc;j()Vnamed checkAllocatedLnet/minecraft/client/texture/NativeImage;checkAllocated()V
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getWidth
public int getWidth()- Mappings:
Namespace Name Mixin selector intermediary method_4307Lnet/minecraft/class_1011;method_4307()Iofficial aLehc;a()Inamed getWidthLnet/minecraft/client/texture/NativeImage;getWidth()I
-
getHeight
public int getHeight()- Mappings:
Namespace Name Mixin selector intermediary method_4323Lnet/minecraft/class_1011;method_4323()Iofficial bLehc;b()Inamed getHeightLnet/minecraft/client/texture/NativeImage;getHeight()I
-
getFormat
- Mappings:
Namespace Name Mixin selector intermediary method_4318Lnet/minecraft/class_1011;method_4318()Lnet/minecraft/class_1011$class_1012;official cLehc;c()Lehc$a;named getFormatLnet/minecraft/client/texture/NativeImage;getFormat()Lnet/minecraft/client/texture/NativeImage$Format;
-
getColor
public int getColor(int x, int y) Gets the color of a pixel on this native image. The color returned by this method will be in a big-endian (from biggest to smallest bits) ABGR format, or little-endian RGBA.- Returns:
- the color, with red at smallest and alpha at biggest bits
- Throws:
IllegalArgumentException- when this native image's format is not little-endian RGBA, or the coordinate is out-of-bounds- Mappings:
Namespace Name Mixin selector intermediary method_4315Lnet/minecraft/class_1011;method_4315(II)Iofficial aLehc;a(II)Inamed getColorLnet/minecraft/client/texture/NativeImage;getColor(II)I
-
setColor
public void setColor(int x, int y, int color) Sets the color of a pixel on this native image. The color to be set by this method will be in a big-endian (from biggest to smallest bits) ABGR format, or little-endian RGBA.- Parameters:
color- the color, with red at smallest and alpha at biggest bits- Throws:
IllegalArgumentException- when this native image's format is not little-endian RGBA, or the coordinate is out-of-bounds- Mappings:
Namespace Name Mixin selector intermediary method_4305Lnet/minecraft/class_1011;method_4305(III)Vofficial aLehc;a(III)Vnamed setColorLnet/minecraft/client/texture/NativeImage;setColor(III)V
-
applyToCopy
- Mappings:
Namespace Name Mixin selector intermediary method_48462Lnet/minecraft/class_1011;method_48462(Ljava/util/function/IntUnaryOperator;)Lnet/minecraft/class_1011;official aLehc;a(Ljava/util/function/IntUnaryOperator;)Lehc;named applyToCopyLnet/minecraft/client/texture/NativeImage;applyToCopy(Ljava/util/function/IntUnaryOperator;)Lnet/minecraft/client/texture/NativeImage;
-
apply
- Mappings:
Namespace Name Mixin selector intermediary method_51596Lnet/minecraft/class_1011;method_51596(Ljava/util/function/IntUnaryOperator;)Vofficial bLehc;b(Ljava/util/function/IntUnaryOperator;)Vnamed applyLnet/minecraft/client/texture/NativeImage;apply(Ljava/util/function/IntUnaryOperator;)V
-
copyPixelsRgba
public int[] copyPixelsRgba()- Mappings:
Namespace Name Mixin selector intermediary method_48463Lnet/minecraft/class_1011;method_48463()[Iofficial dLehc;d()[Inamed copyPixelsRgbaLnet/minecraft/client/texture/NativeImage;copyPixelsRgba()[I
-
setLuminance
public void setLuminance(int x, int y, byte luminance) - Mappings:
Namespace Name Mixin selector intermediary method_35621Lnet/minecraft/class_1011;method_35621(IIB)Vofficial aLehc;a(IIB)Vnamed setLuminanceLnet/minecraft/client/texture/NativeImage;setLuminance(IIB)V
-
getRed
public byte getRed(int x, int y) - Mappings:
Namespace Name Mixin selector intermediary method_35623Lnet/minecraft/class_1011;method_35623(II)Bofficial bLehc;b(II)Bnamed getRedLnet/minecraft/client/texture/NativeImage;getRed(II)B
-
getGreen
public byte getGreen(int x, int y) - Mappings:
Namespace Name Mixin selector intermediary method_35625Lnet/minecraft/class_1011;method_35625(II)Bofficial cLehc;c(II)Bnamed getGreenLnet/minecraft/client/texture/NativeImage;getGreen(II)B
-
getBlue
public byte getBlue(int x, int y) - Mappings:
Namespace Name Mixin selector intermediary method_35626Lnet/minecraft/class_1011;method_35626(II)Bofficial dLehc;d(II)Bnamed getBlueLnet/minecraft/client/texture/NativeImage;getBlue(II)B
-
getOpacity
public byte getOpacity(int x, int y) - Mappings:
Namespace Name Mixin selector intermediary method_4311Lnet/minecraft/class_1011;method_4311(II)Bofficial eLehc;e(II)Bnamed getOpacityLnet/minecraft/client/texture/NativeImage;getOpacity(II)B
-
blend
public void blend(int x, int y, int color) - Mappings:
Namespace Name Mixin selector intermediary method_35624Lnet/minecraft/class_1011;method_35624(III)Vofficial bLehc;b(III)Vnamed blendLnet/minecraft/client/texture/NativeImage;blend(III)V
-
makePixelArray
Deprecated.- Mappings:
Namespace Name Mixin selector intermediary method_4322Lnet/minecraft/class_1011;method_4322()[Iofficial eLehc;e()[Inamed makePixelArrayLnet/minecraft/client/texture/NativeImage;makePixelArray()[I
-
upload
public void upload(int level, int offsetX, int offsetY, boolean close) - Mappings:
Namespace Name Mixin selector intermediary method_4301Lnet/minecraft/class_1011;method_4301(IIIZ)Vofficial aLehc;a(IIIZ)Vnamed uploadLnet/minecraft/client/texture/NativeImage;upload(IIIZ)V
-
upload
public void upload(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean mipmap, boolean close) - Mappings:
Namespace Name Mixin selector intermediary method_4312Lnet/minecraft/class_1011;method_4312(IIIIIIIZZ)Vofficial aLehc;a(IIIIIIIZZ)Vnamed uploadLnet/minecraft/client/texture/NativeImage;upload(IIIIIIIZZ)V
-
upload
public void upload(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean close) - Mappings:
Namespace Name Mixin selector intermediary method_22619Lnet/minecraft/class_1011;method_22619(IIIIIIIZZZZ)Vofficial aLehc;a(IIIIIIIZZZZ)Vnamed uploadLnet/minecraft/client/texture/NativeImage;upload(IIIIIIIZZZZ)V
-
uploadInternal
private void uploadInternal(int level, int offsetX, int offsetY, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean close) - Mappings:
Namespace Name Mixin selector intermediary method_4321Lnet/minecraft/class_1011;method_4321(IIIIIIIZZZZ)Vofficial bLehc;b(IIIIIIIZZZZ)Vnamed uploadInternalLnet/minecraft/client/texture/NativeImage;uploadInternal(IIIIIIIZZZZ)V
-
loadFromTextureImage
public void loadFromTextureImage(int level, boolean removeAlpha) - Mappings:
Namespace Name Mixin selector intermediary method_4327Lnet/minecraft/class_1011;method_4327(IZ)Vofficial aLehc;a(IZ)Vnamed loadFromTextureImageLnet/minecraft/client/texture/NativeImage;loadFromTextureImage(IZ)V
-
readDepthComponent
public void readDepthComponent(float unused) - Mappings:
Namespace Name Mixin selector intermediary method_35620Lnet/minecraft/class_1011;method_35620(F)Vofficial aLehc;a(F)Vnamed readDepthComponentLnet/minecraft/client/texture/NativeImage;readDepthComponent(F)V
-
drawPixels
public void drawPixels()Useuploadto upload this image to GL so it can be used later. This method is not used in vanilla, and its side effects are not yet known.- Mappings:
Namespace Name Mixin selector intermediary method_35627Lnet/minecraft/class_1011;method_35627()Vofficial fLehc;f()Vnamed drawPixelsLnet/minecraft/client/texture/NativeImage;drawPixels()V
-
writeTo
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4325Lnet/minecraft/class_1011;method_4325(Ljava/io/File;)Vofficial aLehc;a(Ljava/io/File;)Vnamed writeToLnet/minecraft/client/texture/NativeImage;writeTo(Ljava/io/File;)V
-
makeGlyphBitmapSubpixel
public void makeGlyphBitmapSubpixel(STBTTFontinfo fontInfo, int glyphIndex, int width, int height, float scaleX, float scaleY, float shiftX, float shiftY, int startX, int startY) - Mappings:
Namespace Name Mixin selector intermediary method_4316Lnet/minecraft/class_1011;method_4316(Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)Vofficial aLehc;a(Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)Vnamed makeGlyphBitmapSubpixelLnet/minecraft/client/texture/NativeImage;makeGlyphBitmapSubpixel(Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)V
-
writeTo
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_4314Lnet/minecraft/class_1011;method_4314(Ljava/nio/file/Path;)Vofficial aLehc;a(Ljava/nio/file/Path;)Vnamed writeToLnet/minecraft/client/texture/NativeImage;writeTo(Ljava/nio/file/Path;)V
-
getBytes
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_24036Lnet/minecraft/class_1011;method_24036()[Bofficial gLehc;g()[Bnamed getBytesLnet/minecraft/client/texture/NativeImage;getBytes()[B
-
write
- Throws:
IOException- Mappings:
Namespace Name Mixin selector intermediary method_24032Lnet/minecraft/class_1011;method_24032(Ljava/nio/channels/WritableByteChannel;)Zofficial aLehc;a(Ljava/nio/channels/WritableByteChannel;)Znamed writeLnet/minecraft/client/texture/NativeImage;write(Ljava/nio/channels/WritableByteChannel;)Z
-
copyFrom
- Mappings:
Namespace Name Mixin selector intermediary method_4317Lnet/minecraft/class_1011;method_4317(Lnet/minecraft/class_1011;)Vofficial aLehc;a(Lehc;)Vnamed copyFromLnet/minecraft/client/texture/NativeImage;copyFrom(Lnet/minecraft/client/texture/NativeImage;)V
-
fillRect
public void fillRect(int x, int y, int width, int height, int color) - Mappings:
Namespace Name Mixin selector intermediary method_4326Lnet/minecraft/class_1011;method_4326(IIIII)Vofficial aLehc;a(IIIII)Vnamed fillRectLnet/minecraft/client/texture/NativeImage;fillRect(IIIII)V
-
copyRect
public void copyRect(int x, int y, int translateX, int translateY, int width, int height, boolean flipX, boolean flipY) - Mappings:
Namespace Name Mixin selector intermediary method_4304Lnet/minecraft/class_1011;method_4304(IIIIIIZZ)Vofficial aLehc;a(IIIIIIZZ)Vnamed copyRectLnet/minecraft/client/texture/NativeImage;copyRect(IIIIIIZZ)V
-
copyRect
public void copyRect(NativeImage image, int x, int y, int destX, int destY, int width, int height, boolean flipX, boolean flipY) - Mappings:
Namespace Name Mixin selector intermediary method_47594Lnet/minecraft/class_1011;method_47594(Lnet/minecraft/class_1011;IIIIIIZZ)Vofficial aLehc;a(Lehc;IIIIIIZZ)Vnamed copyRectLnet/minecraft/client/texture/NativeImage;copyRect(Lnet/minecraft/client/texture/NativeImage;IIIIIIZZ)V
-
mirrorVertically
public void mirrorVertically()- Mappings:
Namespace Name Mixin selector intermediary method_4319Lnet/minecraft/class_1011;method_4319()Vofficial hLehc;h()Vnamed mirrorVerticallyLnet/minecraft/client/texture/NativeImage;mirrorVertically()V
-
resizeSubRectTo
- Mappings:
Namespace Name Mixin selector intermediary method_4300Lnet/minecraft/class_1011;method_4300(IIIILnet/minecraft/class_1011;)Vofficial aLehc;a(IIIILehc;)Vnamed resizeSubRectToLnet/minecraft/client/texture/NativeImage;resizeSubRectTo(IIIILnet/minecraft/client/texture/NativeImage;)V
-
untrack
public void untrack()- Mappings:
Namespace Name Mixin selector intermediary method_4302Lnet/minecraft/class_1011;method_4302()Vofficial iLehc;i()Vnamed untrackLnet/minecraft/client/texture/NativeImage;untrack()V
-