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
static 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 Set
<StandardOpenOption> private long
private final long
private final boolean
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionNativeImage
(int width, int height, boolean useCalloc) NativeImage
(NativeImage.Format format, int width, int height, boolean useCalloc) private
NativeImage
(NativeImage.Format format, int width, int height, boolean useStbFree, long pixels) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
_upload
(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean autoClose) void
applyToAllPixels
(IntUnaryOperator function) byte[]
void
blendPixel
(int x, int y, int abgrColor) private void
void
close()
void
copyFrom
(NativeImage other) boolean
copyFromFont
(org.lwjgl.util.freetype.FT_Face face, int index) void
copyRect
(int xFrom, int yFrom, int xToDelta, int yToDelta, int width, int height, boolean mirrorX, boolean mirrorY) void
copyRect
(NativeImage source, int xFrom, int yFrom, int xTo, int yTo, int width, int height, boolean mirrorX, boolean mirrorY) void
downloadDepthBuffer
(float unused) void
downloadTexture
(int level, boolean opaque) void
void
fillRect
(int x, int y, int width, int height, int value) void
flipY()
format()
byte
getBlueOrLuminance
(int x, int y) byte
getGreenOrLuminance
(int x, int y) int
byte
getLuminanceOrAlpha
(int x, int y) int
getPixelRGBA
(int x, int y) int[]
byte
getRedOrLuminance
(int x, int y) int
getWidth()
private boolean
isOutsideBounds
(int x, int y) int[]
Deprecated.mappedCopy
(IntUnaryOperator function) static NativeImage
read
(byte[] bytes) static NativeImage
read
(NativeImage.Format format, InputStream textureStream) static NativeImage
read
(NativeImage.Format format, ByteBuffer textureData) static NativeImage
read
(InputStream textureStream) static NativeImage
read
(ByteBuffer textureData) void
resizeSubRectTo
(int x, int y, int width, int height, NativeImage image) private static void
setFilter
(boolean linear, boolean mipmap) void
setPixelLuminance
(int x, int y, byte luminance) void
setPixelRGBA
(int x, int y, int abgrColor) toString()
void
untrack()
void
upload
(int level, int xOffset, int yOffset, boolean mipmap) void
upload
(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean mipmap, boolean autoClose) void
upload
(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean autoClose) private boolean
writeToChannel
(WritableByteChannel channel) void
writeToFile
(File file) void
writeToFile
(Path path)
-
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 width, int height, boolean useCalloc) -
NativeImage
-
NativeImage
private 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
-
read
public static NativeImage read(@Nullable NativeImage.Format format, ByteBuffer textureData) throws IOException - Throws:
IOException
-
setFilter
private static void setFilter(boolean linear, boolean mipmap) -
checkAllocated
private void checkAllocated() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
format
-
getPixelRGBA
public int getPixelRGBA(int x, int y) -
setPixelRGBA
public void setPixelRGBA(int x, int y, int abgrColor) -
mappedCopy
-
applyToAllPixels
-
getPixelsRGBA
public int[] getPixelsRGBA() -
setPixelLuminance
public void setPixelLuminance(int x, int y, byte luminance) -
getRedOrLuminance
public byte getRedOrLuminance(int x, int y) -
getGreenOrLuminance
public byte getGreenOrLuminance(int x, int y) -
getBlueOrLuminance
public byte getBlueOrLuminance(int x, int y) -
getLuminanceOrAlpha
public byte getLuminanceOrAlpha(int x, int y) -
blendPixel
public void blendPixel(int x, int y, int abgrColor) -
makePixelArray
Deprecated. -
upload
public void upload(int level, int xOffset, int yOffset, boolean mipmap) -
upload
public void upload(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean mipmap, boolean autoClose) -
upload
public void upload(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean autoClose) -
_upload
private void _upload(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int width, int height, boolean blur, boolean clamp, boolean mipmap, boolean autoClose) -
downloadTexture
public void downloadTexture(int level, boolean opaque) -
downloadDepthBuffer
public void downloadDepthBuffer(float unused) -
drawPixels
public void drawPixels() -
writeToFile
- Throws:
IOException
-
copyFromFont
public boolean copyFromFont(org.lwjgl.util.freetype.FT_Face face, int index) -
writeToFile
- Throws:
IOException
-
asByteArray
- 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) -
flipY
public void flipY() -
resizeSubRectTo
-
untrack
public void untrack()
-