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.Formatprivate final intprivate static final org.slf4j.Loggerprivate static final com.mojang.jtracy.MemoryPoolprivate static final Set<StandardOpenOption> private longprivate final longprivate final booleanprivate 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 voidvoidclose()voidcopyFrom(NativeImage pOther) booleancopyFromFont(org.lwjgl.util.freetype.FT_Face pFace, int pIndex) voidcopyRect(int pXFrom, int pYFrom, int pXToDelta, int pYToDelta, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) voidcopyRect(NativeImage pTarget, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) voidfillRect(int pX, int pY, int pWidth, int pHeight, int pValue) format()intbytegetLuminanceOrAlpha(int pX, int pY) intgetPixel(int pX, int pY) private intgetPixelABGR(int pX, int pY) int[]int[]longintgetWidth()private booleanisOutsideBounds(int pX, int pY) int[]Deprecated.mappedCopy(IntUnaryOperator pFunction) private static NativeImageputAndRead(ByteBuffer pBuffer, byte[] pBytes) static NativeImageread(byte[] pBytes) static NativeImageread(NativeImage.Format pFormat, InputStream pTextureStream) static NativeImageread(NativeImage.Format pFormat, ByteBuffer pTextureData) static NativeImageread(InputStream pTextureStream) static NativeImageread(ByteBuffer pTextureData) voidresizeSubRectTo(int pX, int pY, int pWidth, int pHeight, NativeImage pImage) voidsetPixel(int pX, int pY, int pColor) voidsetPixelABGR(int pX, int pY, int pColor) toString()voiduntrack()private booleanwriteToChannel(WritableByteChannel pChannel) voidwriteToFile(File pFile) voidwriteToFile(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:
closein 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 pFace, int pIndex) -
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 pTarget, 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()
-