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 enumstatic 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
ConstructorsModifierConstructorDescriptionNativeImage(int pWidth, int pHeight, boolean pUseCalloc) NativeImage(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseCalloc) privateNativeImage(NativeImage.Format pFormat, int pWidth, int pHeight, boolean pUseStbFree, long pPixels) -
Method Summary
Modifier and TypeMethodDescriptionprivate void_upload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pAutoClose) voidapplyToAllPixels(IntUnaryOperator pFunction) private 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 pSource, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) voiddownloadDepthBuffer(float pUnused) voiddownloadTexture(int pLevel, boolean pOpaque) voidvoidfillRect(int pX, int pY, int pWidth, int pHeight, int pValue) voidflipY()format()intbytegetLuminanceOrAlpha(int pX, int pY) intgetPixel(int pX, int pY) private intgetPixelABGR(int pX, int pY) int[]int[]intgetWidth()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) private voidsetPixelABGR(int pX, int pY, int pColor) toString()voiduntrack()voidupload(int pLevel, int pXOffset, int pYOffset, boolean pMipmap) voidupload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pAutoClose) 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
private 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
private void setPixelABGR(int pX, int pY, int pColor) -
setPixel
public void setPixel(int pX, int pY, int pColor) -
mappedCopy
-
applyToAllPixels
-
getPixelsABGR
public int[] getPixelsABGR() -
getPixels
public int[] getPixels() -
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int pX, int pY) -
makePixelArray
Deprecated. -
upload
public void upload(int pLevel, int pXOffset, int pYOffset, boolean pMipmap) -
upload
public void upload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pAutoClose) -
_upload
private void _upload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pAutoClose) -
downloadTexture
public void downloadTexture(int pLevel, boolean pOpaque) -
downloadDepthBuffer
public void downloadDepthBuffer(float pUnused) -
drawPixels
public void drawPixels() -
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 pSource, int pXFrom, int pYFrom, int pXTo, int pYTo, int pWidth, int pHeight, boolean pMirrorX, boolean pMirrorY) -
flipY
public void flipY() -
resizeSubRectTo
-
untrack
public void untrack()
-