Class NativeImage
- java.lang.Object
-
- net.minecraft.client.renderer.texture.NativeImage
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class NativeImage extends java.lang.Object implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NativeImage.PixelFormat
static class
NativeImage.PixelFormatGLCode
(package private) static class
NativeImage.WriteCallback
-
Field Summary
Fields Modifier and Type Field Description private NativeImage.PixelFormat
format
private int
height
private static org.apache.logging.log4j.Logger
LOGGER
private static java.util.Set<java.nio.file.StandardOpenOption>
OPEN_OPTIONS
private long
pixels
private long
size
private boolean
useStbFree
private int
width
-
Constructor Summary
Constructors Modifier Constructor Description NativeImage(int p_i48122_1_, int p_i48122_2_, boolean p_i48122_3_)
NativeImage(NativeImage.PixelFormat p_i49763_1_, int p_i49763_2_, int p_i49763_3_, boolean p_i49763_4_)
private
NativeImage(NativeImage.PixelFormat p_i49764_1_, int p_i49764_2_, int p_i49764_3_, boolean p_i49764_4_, long p_i49764_5_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
_upload(int p_227792_1_, int p_227792_2_, int p_227792_3_, int p_227792_4_, int p_227792_5_, int p_227792_6_, int p_227792_7_, boolean p_227792_8_, boolean p_227792_9_, boolean p_227792_10_, boolean p_227792_11_)
byte[]
asByteArray()
private void
checkAllocated()
void
close()
static int
combine(int p_227787_0_, int p_227787_1_, int p_227787_2_, int p_227787_3_)
void
copyFrom(NativeImage p_195703_1_)
void
copyFromFont(org.lwjgl.stb.STBTTFontinfo p_211676_1_, int p_211676_2_, int p_211676_3_, int p_211676_4_, float p_211676_5_, float p_211676_6_, float p_211676_7_, float p_211676_8_, int p_211676_9_, int p_211676_10_)
void
copyRect(int p_195699_1_, int p_195699_2_, int p_195699_3_, int p_195699_4_, int p_195699_5_, int p_195699_6_, boolean p_195699_7_, boolean p_195699_8_)
void
downloadTexture(int p_195717_1_, boolean p_195717_2_)
void
fillRect(int p_195715_1_, int p_195715_2_, int p_195715_3_, int p_195715_4_, int p_195715_5_)
void
flipY()
NativeImage.PixelFormat
format()
static NativeImage
fromBase64(java.lang.String p_216511_0_)
static int
getA(int p_227786_0_)
static int
getB(int p_227795_0_)
static int
getG(int p_227793_0_)
int
getHeight()
byte
getLuminanceOrAlpha(int p_211675_1_, int p_211675_2_)
int
getPixelRGBA(int p_195709_1_, int p_195709_2_)
static int
getR(int p_227791_0_)
int
getWidth()
int[]
makePixelArray()
Deprecated.static NativeImage
read(java.io.InputStream p_195713_0_)
static NativeImage
read(java.nio.ByteBuffer p_195704_0_)
static NativeImage
read(NativeImage.PixelFormat p_211679_0_, java.io.InputStream p_211679_1_)
static NativeImage
read(NativeImage.PixelFormat p_211677_0_, java.nio.ByteBuffer p_211677_1_)
void
resizeSubRectTo(int p_195708_1_, int p_195708_2_, int p_195708_3_, int p_195708_4_, NativeImage p_195708_5_)
private static void
setClamp(boolean p_195707_0_)
private static void
setFilter(boolean p_195705_0_, boolean p_195705_1_)
void
setPixelRGBA(int p_195700_1_, int p_195700_2_, int p_195700_3_)
java.lang.String
toString()
void
untrack()
void
upload(int p_195697_1_, int p_195697_2_, int p_195697_3_, boolean p_195697_4_)
void
upload(int p_227788_1_, int p_227788_2_, int p_227788_3_, int p_227788_4_, int p_227788_5_, int p_227788_6_, int p_227788_7_, boolean p_227788_8_, boolean p_227788_9_)
void
upload(int p_227789_1_, int p_227789_2_, int p_227789_3_, int p_227789_4_, int p_227789_5_, int p_227789_6_, int p_227789_7_, boolean p_227789_8_, boolean p_227789_9_, boolean p_227789_10_, boolean p_227789_11_)
private boolean
writeToChannel(java.nio.channels.WritableByteChannel p_227790_1_)
void
writeToFile(java.io.File p_209271_1_)
void
writeToFile(java.nio.file.Path p_209270_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
OPEN_OPTIONS
private static final java.util.Set<java.nio.file.StandardOpenOption> OPEN_OPTIONS
-
format
private final NativeImage.PixelFormat format
-
width
private final int width
-
height
private final int height
-
useStbFree
private final boolean useStbFree
-
pixels
private long pixels
-
size
private final long size
-
-
Constructor Detail
-
NativeImage
public NativeImage(int p_i48122_1_, int p_i48122_2_, boolean p_i48122_3_)
-
NativeImage
public NativeImage(NativeImage.PixelFormat p_i49763_1_, int p_i49763_2_, int p_i49763_3_, boolean p_i49763_4_)
-
NativeImage
private NativeImage(NativeImage.PixelFormat p_i49764_1_, int p_i49764_2_, int p_i49764_3_, boolean p_i49764_4_, long p_i49764_5_)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
read
public static NativeImage read(java.io.InputStream p_195713_0_) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static NativeImage read(@Nullable NativeImage.PixelFormat p_211679_0_, java.io.InputStream p_211679_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static NativeImage read(java.nio.ByteBuffer p_195704_0_) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static NativeImage read(@Nullable NativeImage.PixelFormat p_211677_0_, java.nio.ByteBuffer p_211677_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
setClamp
private static void setClamp(boolean p_195707_0_)
-
setFilter
private static void setFilter(boolean p_195705_0_, boolean p_195705_1_)
-
checkAllocated
private void checkAllocated()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
format
public NativeImage.PixelFormat format()
-
getPixelRGBA
public int getPixelRGBA(int p_195709_1_, int p_195709_2_)
-
setPixelRGBA
public void setPixelRGBA(int p_195700_1_, int p_195700_2_, int p_195700_3_)
-
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int p_211675_1_, int p_211675_2_)
-
makePixelArray
@Deprecated public int[] makePixelArray()
Deprecated.
-
upload
public void upload(int p_195697_1_, int p_195697_2_, int p_195697_3_, boolean p_195697_4_)
-
upload
public void upload(int p_227788_1_, int p_227788_2_, int p_227788_3_, int p_227788_4_, int p_227788_5_, int p_227788_6_, int p_227788_7_, boolean p_227788_8_, boolean p_227788_9_)
-
upload
public void upload(int p_227789_1_, int p_227789_2_, int p_227789_3_, int p_227789_4_, int p_227789_5_, int p_227789_6_, int p_227789_7_, boolean p_227789_8_, boolean p_227789_9_, boolean p_227789_10_, boolean p_227789_11_)
-
_upload
private void _upload(int p_227792_1_, int p_227792_2_, int p_227792_3_, int p_227792_4_, int p_227792_5_, int p_227792_6_, int p_227792_7_, boolean p_227792_8_, boolean p_227792_9_, boolean p_227792_10_, boolean p_227792_11_)
-
downloadTexture
public void downloadTexture(int p_195717_1_, boolean p_195717_2_)
-
writeToFile
public void writeToFile(java.io.File p_209271_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
copyFromFont
public void copyFromFont(org.lwjgl.stb.STBTTFontinfo p_211676_1_, int p_211676_2_, int p_211676_3_, int p_211676_4_, float p_211676_5_, float p_211676_6_, float p_211676_7_, float p_211676_8_, int p_211676_9_, int p_211676_10_)
-
writeToFile
public void writeToFile(java.nio.file.Path p_209270_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
asByteArray
public byte[] asByteArray() throws java.io.IOException
- Throws:
java.io.IOException
-
writeToChannel
private boolean writeToChannel(java.nio.channels.WritableByteChannel p_227790_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
copyFrom
public void copyFrom(NativeImage p_195703_1_)
-
fillRect
public void fillRect(int p_195715_1_, int p_195715_2_, int p_195715_3_, int p_195715_4_, int p_195715_5_)
-
copyRect
public void copyRect(int p_195699_1_, int p_195699_2_, int p_195699_3_, int p_195699_4_, int p_195699_5_, int p_195699_6_, boolean p_195699_7_, boolean p_195699_8_)
-
flipY
public void flipY()
-
resizeSubRectTo
public void resizeSubRectTo(int p_195708_1_, int p_195708_2_, int p_195708_3_, int p_195708_4_, NativeImage p_195708_5_)
-
untrack
public void untrack()
-
fromBase64
public static NativeImage fromBase64(java.lang.String p_216511_0_) throws java.io.IOException
- Throws:
java.io.IOException
-
getA
public static int getA(int p_227786_0_)
-
getR
public static int getR(int p_227791_0_)
-
getG
public static int getG(int p_227793_0_)
-
getB
public static int getB(int p_227795_0_)
-
combine
public static int combine(int p_227787_0_, int p_227787_1_, int p_227787_2_, int p_227787_3_)
-
-