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 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 pBlur, boolean pClamp, boolean pMipmap, boolean pAutoClose) voidapplyToAllPixels(IntUnaryOperator pFunction) byte[]voidblendPixel(int pX, int pY, int pAbgrColor) 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()bytegetBlueOrLuminance(int pX, int pY) bytegetGreenOrLuminance(int pX, int pY) intbytegetLuminanceOrAlpha(int pX, int pY) intgetPixelRGBA(int pX, int pY) int[]bytegetRedOrLuminance(int pX, int pY) intgetWidth()private booleanisOutsideBounds(int pX, int pY) int[]Deprecated.mappedCopy(IntUnaryOperator pFunction) 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) private static voidsetFilter(boolean pLinear, boolean pMipmap) voidsetPixelLuminance(int pX, int pY, byte pLuminance) voidsetPixelRGBA(int pX, int pY, int pAbgrColor) 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 pMipmap, boolean pAutoClose) voidupload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pBlur, boolean pClamp, boolean pMipmap, boolean pAutoClose) private booleanwriteToChannel(WritableByteChannel pChannel) voidwriteToFile(File pFile) voidwriteToFile(Path pPath)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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
-
read
public static NativeImage read(@Nullable NativeImage.Format pFormat, ByteBuffer pTextureData) throws IOException - Throws:
IOException
-
setFilter
private static void setFilter(boolean pLinear, boolean pMipmap) -
checkAllocated
private void checkAllocated() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
format
-
getPixelRGBA
public int getPixelRGBA(int pX, int pY) -
setPixelRGBA
public void setPixelRGBA(int pX, int pY, int pAbgrColor) -
mappedCopy
-
applyToAllPixels
-
getPixelsRGBA
public int[] getPixelsRGBA() -
setPixelLuminance
public void setPixelLuminance(int pX, int pY, byte pLuminance) -
getRedOrLuminance
public byte getRedOrLuminance(int pX, int pY) -
getGreenOrLuminance
public byte getGreenOrLuminance(int pX, int pY) -
getBlueOrLuminance
public byte getBlueOrLuminance(int pX, int pY) -
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int pX, int pY) -
blendPixel
public void blendPixel(int pX, int pY, int pAbgrColor) -
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 pMipmap, boolean pAutoClose) -
upload
public void upload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pBlur, boolean pClamp, boolean pMipmap, boolean pAutoClose) -
_upload
private void _upload(int pLevel, int pXOffset, int pYOffset, int pUnpackSkipPixels, int pUnpackSkipRows, int pWidth, int pHeight, boolean pBlur, boolean pClamp, boolean pMipmap, 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
-
asByteArray
- 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()
-