public final class NativeImage
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
NativeImage.PixelFormat |
static class |
NativeImage.PixelFormatGLCode |
(package private) static class |
NativeImage.WriteCallback |
Modifier and Type | Field and Description |
---|---|
private int |
height |
private long |
imagePointer |
private static org.apache.logging.log4j.Logger |
LOGGER |
private static java.util.Set<java.nio.file.StandardOpenOption> |
OPEN_OPTIONS |
private NativeImage.PixelFormat |
pixelFormat |
private long |
size |
private boolean |
stbiPointer |
private int |
width |
Modifier | Constructor and Description |
---|---|
|
NativeImage(int widthIn,
int heightIn,
boolean clear) |
|
NativeImage(NativeImage.PixelFormat pixelFormatIn,
int widthIn,
int heightIn,
boolean initialize) |
private |
NativeImage(NativeImage.PixelFormat pixelFormatIn,
int widthIn,
int heightIn,
boolean stbiPointerIn,
long pointer) |
Modifier and Type | Method and Description |
---|---|
void |
blendPixel(int xIn,
int yIn,
int colIn) |
private void |
checkImage() |
void |
close() |
void |
copyAreaRGBA(int xFrom,
int yFrom,
int xToDelta,
int yToDelta,
int widthIn,
int heightIn,
boolean mirrorX,
boolean mirrorY) |
void |
copyImageData(NativeImage from) |
void |
downloadFromTexture(int level,
boolean opaque) |
void |
fillAreaRGBA(int x,
int y,
int widthIn,
int heightIn,
int value) |
void |
flip() |
static int |
getAlpha(int col) |
static int |
getBlue(int col) |
byte[] |
getBytes() |
static int |
getCombined(int alpha,
int blue,
int green,
int red) |
NativeImage.PixelFormat |
getFormat() |
static int |
getGreen(int col) |
int |
getHeight() |
byte |
getPixelLuminanceOrAlpha(int x,
int y) |
int |
getPixelRGBA(int x,
int y) |
static int |
getRed(int col) |
int |
getWidth() |
int[] |
makePixelArray()
Deprecated.
|
static NativeImage |
read(java.nio.ByteBuffer byteBufferIn) |
static NativeImage |
read(java.io.InputStream inputStreamIn) |
static NativeImage |
read(NativeImage.PixelFormat pixelFormatIn,
java.nio.ByteBuffer byteBufferIn) |
static NativeImage |
read(NativeImage.PixelFormat pixelFormatIn,
java.io.InputStream inputStreamIn) |
static NativeImage |
readBase64(java.lang.String stringIn) |
void |
renderGlyph(org.lwjgl.stb.STBTTFontinfo info,
int glyphIndex,
int widthIn,
int heightIn,
float scaleX,
float scaleY,
float shiftX,
float shiftY,
int x,
int y) |
void |
resizeSubRectTo(int xIn,
int yIn,
int widthIn,
int heightIn,
NativeImage imageIn) |
private static void |
setMinMagFilters(boolean linear,
boolean mipmap) |
void |
setPixelRGBA(int x,
int y,
int value) |
private static void |
setWrapST(boolean clamp) |
java.lang.String |
toString() |
void |
untrack() |
void |
uploadTextureSub(int level,
int xOffset,
int yOffset,
boolean mipmap) |
void |
uploadTextureSub(int level,
int xOffset,
int yOffset,
int unpackSkipPixels,
int unpackSkipRows,
int widthIn,
int heightIn,
boolean mipmap,
boolean autoClose) |
void |
uploadTextureSub(int level,
int xOffset,
int yOffset,
int unpackSkipPixels,
int unpackSkipRows,
int widthIn,
int heightIn,
boolean blur,
boolean clamp,
boolean mipmap,
boolean autoClose) |
private void |
uploadTextureSubRaw(int level,
int xOffset,
int yOffset,
int unpackSkipPixels,
int unpackSkipRows,
int widthIn,
int heightIn,
boolean blur,
boolean clamp,
boolean mipmap,
boolean autoClose) |
void |
write(java.io.File fileIn) |
void |
write(java.nio.file.Path pathIn) |
private boolean |
write(java.nio.channels.WritableByteChannel channelIn) |
private static final org.apache.logging.log4j.Logger LOGGER
private static final java.util.Set<java.nio.file.StandardOpenOption> OPEN_OPTIONS
private final NativeImage.PixelFormat pixelFormat
private final int width
private final int height
private final boolean stbiPointer
private long imagePointer
private final long size
public NativeImage(int widthIn, int heightIn, boolean clear)
public NativeImage(NativeImage.PixelFormat pixelFormatIn, int widthIn, int heightIn, boolean initialize)
private NativeImage(NativeImage.PixelFormat pixelFormatIn, int widthIn, int heightIn, boolean stbiPointerIn, long pointer)
public java.lang.String toString()
toString
in class java.lang.Object
public static NativeImage read(java.io.InputStream inputStreamIn) throws java.io.IOException
java.io.IOException
public static NativeImage read(@Nullable NativeImage.PixelFormat pixelFormatIn, java.io.InputStream inputStreamIn) throws java.io.IOException
java.io.IOException
public static NativeImage read(java.nio.ByteBuffer byteBufferIn) throws java.io.IOException
java.io.IOException
public static NativeImage read(@Nullable NativeImage.PixelFormat pixelFormatIn, java.nio.ByteBuffer byteBufferIn) throws java.io.IOException
java.io.IOException
private static void setWrapST(boolean clamp)
private static void setMinMagFilters(boolean linear, boolean mipmap)
private void checkImage()
public void close()
close
in interface java.lang.AutoCloseable
public int getWidth()
public int getHeight()
public NativeImage.PixelFormat getFormat()
public int getPixelRGBA(int x, int y)
public void setPixelRGBA(int x, int y, int value)
public byte getPixelLuminanceOrAlpha(int x, int y)
public void blendPixel(int xIn, int yIn, int colIn)
@Deprecated public int[] makePixelArray()
public void uploadTextureSub(int level, int xOffset, int yOffset, boolean mipmap)
public void uploadTextureSub(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int widthIn, int heightIn, boolean mipmap, boolean autoClose)
public void uploadTextureSub(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int widthIn, int heightIn, boolean blur, boolean clamp, boolean mipmap, boolean autoClose)
private void uploadTextureSubRaw(int level, int xOffset, int yOffset, int unpackSkipPixels, int unpackSkipRows, int widthIn, int heightIn, boolean blur, boolean clamp, boolean mipmap, boolean autoClose)
public void downloadFromTexture(int level, boolean opaque)
public void write(java.io.File fileIn) throws java.io.IOException
java.io.IOException
public void renderGlyph(org.lwjgl.stb.STBTTFontinfo info, int glyphIndex, int widthIn, int heightIn, float scaleX, float scaleY, float shiftX, float shiftY, int x, int y)
public void write(java.nio.file.Path pathIn) throws java.io.IOException
java.io.IOException
public byte[] getBytes() throws java.io.IOException
java.io.IOException
private boolean write(java.nio.channels.WritableByteChannel channelIn) throws java.io.IOException
java.io.IOException
public void copyImageData(NativeImage from)
public void fillAreaRGBA(int x, int y, int widthIn, int heightIn, int value)
public void copyAreaRGBA(int xFrom, int yFrom, int xToDelta, int yToDelta, int widthIn, int heightIn, boolean mirrorX, boolean mirrorY)
public void flip()
public void resizeSubRectTo(int xIn, int yIn, int widthIn, int heightIn, NativeImage imageIn)
public void untrack()
public static NativeImage readBase64(java.lang.String stringIn) throws java.io.IOException
java.io.IOException
public static int getAlpha(int col)
public static int getRed(int col)
public static int getGreen(int col)
public static int getBlue(int col)
public static int getCombined(int alpha, int blue, int green, int red)