Package org.lwjgl.stb
Class STBDXT
java.lang.Object
org.lwjgl.stb.STBDXT
Native bindings to stb_dxt.h from the stb library.
DXT1/DXT5 compressor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUse dithering.static final intHigh quality mode, does two refinement steps instead of 1.static final int -
Method Summary
Modifier and TypeMethodDescriptionstatic voidnstb_compress_bc4_block(long dest, long src_r_one_byte_per_pixel) Unsafe version of:compress_bc4_blockstatic voidnstb_compress_bc5_block(long dest, long src_rg_two_byte_per_pixel) Unsafe version of:compress_bc5_blockstatic voidnstb_compress_dxt_block(long dest, long src_rgba_four_bytes_per_pixel, int alpha, int mode) Unsafe version of:compress_dxt_blockstatic voidstb_compress_bc4_block(ByteBuffer dest, ByteBuffer src_r_one_byte_per_pixel) Call this function for every block (you must pad).static voidstb_compress_bc5_block(ByteBuffer dest, ByteBuffer src_rg_two_byte_per_pixel) Call this function for every block (you must pad).static voidstb_compress_dxt_block(ByteBuffer dest, ByteBuffer src_rgba_four_bytes_per_pixel, boolean alpha, int mode) Call this function for every block (you must pad).
-
Field Details
-
STB_DXT_NORMAL
public static final int STB_DXT_NORMAL- See Also:
-
STB_DXT_DITHER
public static final int STB_DXT_DITHERUse dithering. Was always dubious, now deprecated. Does nothing!- See Also:
-
STB_DXT_HIGHQUAL
public static final int STB_DXT_HIGHQUALHigh quality mode, does two refinement steps instead of 1. ~30-40% slower.- See Also:
-
-
Method Details
-
nstb_compress_dxt_block
public static void nstb_compress_dxt_block(long dest, long src_rgba_four_bytes_per_pixel, int alpha, int mode) Unsafe version of:compress_dxt_block -
stb_compress_dxt_block
public static void stb_compress_dxt_block(ByteBuffer dest, ByteBuffer src_rgba_four_bytes_per_pixel, boolean alpha, int mode) Call this function for every block (you must pad).The source should be a 4x4 block of RGBA data in row-major order. Alpha channel is not stored if you specify
alpha=0(but you must supply some constant alpha in the alpha channel). You can turn on dithering and "high quality" usingmode.- Parameters:
dest- a buffer in which to store the compressed blocksrc_rgba_four_bytes_per_pixel- the block to compressalpha- 1 to compress the alpha channel, 0 to ignore itmode- the compression mode. One of:DXT_NORMALDXT_DITHERDXT_HIGHQUAL
-
nstb_compress_bc4_block
public static void nstb_compress_bc4_block(long dest, long src_r_one_byte_per_pixel) Unsafe version of:compress_bc4_block -
stb_compress_bc4_block
Call this function for every block (you must pad). The source should be a 4x4 block of A data in row-major order.- Parameters:
dest- a buffer in which to store the compressed blocksrc_r_one_byte_per_pixel- the block to compress
-
nstb_compress_bc5_block
public static void nstb_compress_bc5_block(long dest, long src_rg_two_byte_per_pixel) Unsafe version of:compress_bc5_block -
stb_compress_bc5_block
Call this function for every block (you must pad). The source should be a 4x4 block of RG data in row-major order.- Parameters:
dest- a buffer in which to store the compressed blocksrc_rg_two_byte_per_pixel- the block to compress
-