Package org.lwjgl.stb

Class STBDXT


  • public class STBDXT
    extends java.lang.Object
    Native bindings to stb_dxt.h from the stb library.

    DXT1/DXT5 compressor.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void nstb_compress_bc4_block​(long dest, long src_r_one_byte_per_pixel)
      Unsafe version of: compress_bc4_block
      static void nstb_compress_bc5_block​(long dest, long src_rg_two_byte_per_pixel)
      Unsafe version of: compress_bc5_block
      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
      static void stb_compress_bc4_block​(java.nio.ByteBuffer dest, java.nio.ByteBuffer src_r_one_byte_per_pixel)
      Call this function for every block (you must pad).
      static void stb_compress_bc5_block​(java.nio.ByteBuffer dest, java.nio.ByteBuffer src_rg_two_byte_per_pixel)
      Call this function for every block (you must pad).
      static void stb_compress_dxt_block​(java.nio.ByteBuffer dest, java.nio.ByteBuffer src_rgba_four_bytes_per_pixel, boolean alpha, int mode)
      Call this function for every block (you must pad).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STB_DXT_DITHER

        public static final int STB_DXT_DITHER
        Use dithering. Dubious win, never use for normal maps and the like!
        See Also:
        Constant Field Values
      • STB_DXT_HIGHQUAL

        public static final int STB_DXT_HIGHQUAL
        High quality mode, does two refinement steps instead of 1. ~30-40% slower.
        See Also:
        Constant Field Values
    • Method Detail

      • 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​(java.nio.ByteBuffer dest,
                                                  java.nio.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; A is ignored if you specify alpha=0; you can turn on dithering and "high quality" using mode.
        Parameters:
        dest - a buffer in which to store the compressed block
        src_rgba_four_bytes_per_pixel - the block to compress
        alpha - 1 to compress the alpha channel, 0 to ignore it
        mode - 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

        public static void stb_compress_bc4_block​(java.nio.ByteBuffer dest,
                                                  java.nio.ByteBuffer src_r_one_byte_per_pixel)
        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 block
        src_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

        public static void stb_compress_bc5_block​(java.nio.ByteBuffer dest,
                                                  java.nio.ByteBuffer src_rg_two_byte_per_pixel)
        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 block
        src_rg_two_byte_per_pixel - the block to compress