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 width, int height, boolean useCalloc) NativeImage(NativeImage.Format format, int width, int height, boolean useCalloc) NativeImage(NativeImage.Format format, int width, int height, boolean useStbFree, long pixels) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclose()voidcopyFrom(NativeImage other) booleancopyFromFont(org.lwjgl.util.freetype.FT_Face face, int index) voidcopyRect(int xFrom, int yFrom, int xToDelta, int yToDelta, int width, int height, boolean mirrorX, boolean mirrorY) voidcopyRect(NativeImage source, int xFrom, int yFrom, int xTo, int yTo, int width, int height, boolean mirrorX, boolean mirrorY) voidfillRect(int x, int y, int width, int height, int value) format()intbytegetLuminanceOrAlpha(int x, int y) intgetPixel(int x, int y) private intgetPixelABGR(int x, int y) int[]int[]longintgetWidth()private booleanisOutsideBounds(int x, int y) int[]Deprecated.mappedCopy(IntUnaryOperator function) private static NativeImageputAndRead(ByteBuffer buffer, byte[] bytes) static NativeImageread(byte[] bytes) static NativeImageread(NativeImage.Format format, InputStream textureStream) static NativeImageread(NativeImage.Format format, ByteBuffer textureData) static NativeImageread(InputStream textureStream) static NativeImageread(ByteBuffer textureData) voidresizeSubRectTo(int x, int y, int width, int height, NativeImage image) voidsetPixel(int x, int y, int color) voidsetPixelABGR(int x, int y, int color) toString()voiduntrack()private booleanwriteToChannel(WritableByteChannel channel) voidwriteToFile(File file) voidwriteToFile(Path path)
-
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 width, int height, boolean useCalloc) -
NativeImage
-
NativeImage
public NativeImage(NativeImage.Format format, int width, int height, boolean useStbFree, long pixels)
-
-
Method Details
-
toString
-
isOutsideBounds
private boolean isOutsideBounds(int x, int y) -
read
- Throws:
IOException
-
read
public static NativeImage read(@Nullable NativeImage.Format format, InputStream textureStream) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
putAndRead
- Throws:
IOException
-
read
public static NativeImage read(@Nullable NativeImage.Format format, ByteBuffer textureData) 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 x, int y) -
getPixel
public int getPixel(int x, int y) -
setPixelABGR
public void setPixelABGR(int x, int y, int color) -
setPixel
public void setPixel(int x, int y, int color) -
mappedCopy
-
getPixelsABGR
public int[] getPixelsABGR() -
getPixels
public int[] getPixels() -
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int x, int y) -
makePixelArray
Deprecated. -
writeToFile
- Throws:
IOException
-
copyFromFont
public boolean copyFromFont(org.lwjgl.util.freetype.FT_Face face, int index) -
writeToFile
- Throws:
IOException
-
writeToChannel
- Throws:
IOException
-
copyFrom
-
fillRect
public void fillRect(int x, int y, int width, int height, int value) -
copyRect
public void copyRect(int xFrom, int yFrom, int xToDelta, int yToDelta, int width, int height, boolean mirrorX, boolean mirrorY) -
copyRect
public void copyRect(NativeImage source, int xFrom, int yFrom, int xTo, int yTo, int width, int height, boolean mirrorX, boolean mirrorY) -
resizeSubRectTo
-
untrack
public void untrack() -
getPointer
public long getPointer()
-