Package com.mojang.blaze3d.platform
Class NativeImage
java.lang.Object
com.mojang.blaze3d.platform.NativeImage
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NativeImage.Format
private final int
private static final org.slf4j.Logger
private static final com.mojang.jtracy.MemoryPool
private static final Set
<StandardOpenOption> private long
private final long
private final boolean
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionNativeImage
(int pWidth, int pHeight, boolean pUseCalloc) NativeImage
(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseCalloc) NativeImage
(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseStbFree, long pPixels) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
void
copyFrom
(NativeImage pOther) boolean
copyFromFont
(org.lwjgl.util.freetype.FT_Face p_320757_, int p_85070_) void
copyRect
(int pXFrom, int pYFrom, int pXToDelta, int pYToDelta, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) void
copyRect
(NativeImage pSource, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) void
fillRect
(int pX, int pY, int pWidth, int pHeight, int pValue) format()
int
byte
getLuminanceOrAlpha
(int pX, int pY) int
getPixel
(int pX, int pY) private int
getPixelABGR
(int pX, int pY) int[]
int[]
long
int
getWidth()
private boolean
isOutsideBounds
(int pX, int pY) int[]
Deprecated.mappedCopy
(IntUnaryOperator pFunction) private static NativeImage
putAndRead
(ByteBuffer pBuffer, byte[] pBytes) static NativeImage
read
(byte[] pBytes) static NativeImage
read
(NativeImage.Format pFormat, InputStream pTextureStream) static NativeImage
read
(NativeImage.Format pFormat, ByteBuffer pTextureData) static NativeImage
read
(InputStream pTextureStream) static NativeImage
read
(ByteBuffer pTextureData) void
resizeSubRectTo
(int pX, int pY, int pWidth, int pHeight, NativeImage pImage) void
setPixel
(int pX, int pY, int pColor) void
setPixelABGR
(int pX, int pY, int pColor) toString()
void
untrack()
private boolean
writeToChannel
(WritableByteChannel pChannel) void
writeToFile
(File pFile) void
writeToFile
(Path pPath)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MEMORY_POOL
private static final com.mojang.jtracy.MemoryPool MEMORY_POOL -
OPEN_OPTIONS
-
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 Details
-
NativeImage
public NativeImage(int pWidth, int pHeight, boolean pUseCalloc) -
NativeImage
-
NativeImage
public NativeImage(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseStbFree, long pPixels)
-
-
Method Details
-
toString
-
isOutsideBounds
private boolean isOutsideBounds(int pX, int pY) -
read
- Throws:
IOException
-
read
public static NativeImage read(@Nullable NativeImage.Format pFormat, InputStream pTextureStream) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
putAndRead
- Throws:
IOException
-
read
public static NativeImage read(@Nullable NativeImage.Format pFormat, ByteBuffer pTextureData) throws IOException - Throws:
IOException
-
checkAllocated
private void checkAllocated() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
format
-
getPixelABGR
private int getPixelABGR(int pX, int pY) -
getPixel
public int getPixel(int pX, int pY) -
setPixelABGR
public void setPixelABGR(int pX, int pY, int pColor) -
setPixel
public void setPixel(int pX, int pY, int pColor) -
mappedCopy
-
getPixelsABGR
public int[] getPixelsABGR() -
getPixels
public int[] getPixels() -
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int pX, int pY) -
makePixelArray
Deprecated. -
writeToFile
- Throws:
IOException
-
copyFromFont
public boolean copyFromFont(org.lwjgl.util.freetype.FT_Face p_320757_, int p_85070_) -
writeToFile
- Throws:
IOException
-
writeToChannel
- Throws:
IOException
-
copyFrom
-
fillRect
public void fillRect(int pX, int pY, int pWidth, int pHeight, int pValue) -
copyRect
public void copyRect(int pXFrom, int pYFrom, int pXToDelta, int pYToDelta, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) -
copyRect
public void copyRect(NativeImage pSource, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) -
resizeSubRectTo
-
untrack
public void untrack() -
getPointer
public long getPointer()
-