Package org.lwjgl.stb

Class STBImage


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

    Quick notes

    Primarily of interest to game developers and other people who can avoid problematic images and only need the trivial interface. Supported formats:

    • JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib
    • PNG 1/2/4/8/16-bit-per-channel
    • TGA (not sure what subset, if a subset)
    • BMP non-1bpp, non-RLE
    • PSD (composited view only, no extra channels, 8/16 bit-per-channel)
    • GIF (*desired_channels always reports as 4-channel)
    • HDR (radiance rgbE format)
    • PIC (Softimage PIC)
    • PNM (PPM and PGM binary only)

    Animated GIF still needs a proper API, but here's one way to do it.

    Features:

    • decode from memory or through FILE (define STBI_NO_STDIO to remove code)
    • decode from arbitrary I/O callbacks
    • SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)

    Limitations:

    • no 12-bit-per-channel JPEG
    • no JPEGs with arithmetic coding
    • GIF always returns *channels_in_file=4

    Basic usage (see HDR discussion below for HDR usage):

    
     int x,y,n;
     unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
     // ... process data if not NULL ...
     // ... x = width, y = height, n = # 8-bit components per pixel ...
     // ... replace '0' with '1'..'4' to force that many components per pixel
     // ... but 'n' will always be the number that it would have been if you said 0
     stbi_image_free(data)

    HDR image support

    stb_image now supports loading HDR images in general, and currently the Radiance .HDR file format, although the support is provided generically. You can still load any file through the existing interface; if you attempt to load an HDR file, it will be automatically remapped to LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; both of these constants can be reconfigured through this interface:

    
     stbi_hdr_to_ldr_gamma(2.2f);
     stbi_hdr_to_ldr_scale(1.0f);

    (note, do not use inverse constants; stbi_image will invert them appropriately).

    Additionally, there is a new, parallel interface for loading files as (linear) floats to preserve the full dynamic range:

    
     float *data = stbi_loadf(filename, &x, &y, &n, 0);

    If you load LDR images through this interface, those images will be promoted to floating point values, run through the inverse of constants corresponding to the above:

    
     stbi_ldr_to_hdr_scale(1.0f);
     stbi_ldr_to_hdr_gamma(2.2f);

    Finally, given a filename (or an open file or memory block) containing image data, you can query for the "most appropriate" interface to use (that is, whether the image is HDR or not), using:

    
     stbi_is_hdr(char *filename);

    iPhone PNG support

    By default we convert iphone-formatted PNGs back to RGB, even though they are internally encoded differently. You can disable this conversion by calling convert_iphone_png_to_rgb(0), in which case you will always just get the native iphone "format" through (which is BGR stored in RGB).

    Call set_unpremultiply_on_load(1) as well to force a divide per pixel to remove any premultiplied alpha *only* if the image file explicitly says there's premultiplied data (currently only happens in iPhone images, and only if iPhone convert-to-rgb processing is on).

    • Method Detail

      • nstbi_load

        public static long nstbi_load​(long filename,
                                      long x,
                                      long y,
                                      long channels_in_file,
                                      int desired_channels)
        Unsafe version of: load
      • stbi_load

        @Nullable
        public static java.nio.ByteBuffer stbi_load​(java.nio.ByteBuffer filename,
                                                    java.nio.IntBuffer x,
                                                    java.nio.IntBuffer y,
                                                    java.nio.IntBuffer channels_in_file,
                                                    int desired_channels)
        
        @Nullable
        public static java.nio.ByteBuffer stbi_load​(java.lang.CharSequence filename,
                                                    java.nio.IntBuffer x,
                                                    java.nio.IntBuffer y,
                                                    java.nio.IntBuffer channels_in_file,
                                                    int desired_channels)
        
        Loads an image from the specified file.

        The return value from an image loader is an 'unsigned char *' which points to the pixel data, or NULL on an allocation failure or if the image is corrupt or invalid. The pixel data consists of *y scanlines of *x pixels, with each pixel consisting of N interleaved 8-bit components; the first pixel pointed to is top-left-most in the image. There is no padding between image scanlines or between pixels, regardless of format. The number of components N is 'desired_channels' if desired_channels is non-zero, or *channels_in_file otherwise. If desired_channels is non-zero, *channels_in_file has the number of components that would have been output otherwise. E.g. if you set desired_channels to 4, you will always get RGBA output, but you can check *channels_in_file to see if it's trivially opaque because e.g. there were only 3 channels in the source image.

        An output image with N components has the following components interleaved in this order in each pixel:

        
         N=#channels_in_file     components
           1                     grey
           2                     grey, alpha
           3                     red, green, blue
           4                     red, green, blue, alpha

        If image loading fails for any reason, the return value will be NULL, and *x, *y, *channels_in_file will be unchanged. The function failure_reason can be queried for an extremely brief, end-user unfriendly explanation of why the load failed.

        Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.

        Parameters:
        filename - the file name
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_from_memory

        public static long nstbi_load_from_memory​(long buffer,
                                                  int len,
                                                  long x,
                                                  long y,
                                                  long channels_in_file,
                                                  int desired_channels)
        Unsafe version of: load_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_load_from_memory

        @Nullable
        public static java.nio.ByteBuffer stbi_load_from_memory​(java.nio.ByteBuffer buffer,
                                                                java.nio.IntBuffer x,
                                                                java.nio.IntBuffer y,
                                                                java.nio.IntBuffer channels_in_file,
                                                                int desired_channels)
        In-memory version of load.
        Parameters:
        buffer - the buffer from which to load the image data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_from_callbacks

        public static long nstbi_load_from_callbacks​(long clbk,
                                                     long user,
                                                     long x,
                                                     long y,
                                                     long channels_in_file,
                                                     int desired_channels)
        Unsafe version of: load_from_callbacks
      • stbi_load_from_callbacks

        @Nullable
        public static java.nio.ByteBuffer stbi_load_from_callbacks​(STBIIOCallbacks clbk,
                                                                   long user,
                                                                   java.nio.IntBuffer x,
                                                                   java.nio.IntBuffer y,
                                                                   java.nio.IntBuffer channels_in_file,
                                                                   int desired_channels)
        Callback version of load.

        I/O callbacks allow you to read from arbitrary sources, like packaged files or some other source. Data read from callbacks are processed through a small internal buffer (currently 128 bytes) to try to reduce overhead.

        The three functions you must define are "read" (reads some bytes of data), "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).

        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_gif_from_memory

        public static long nstbi_load_gif_from_memory​(long buffer,
                                                      int len,
                                                      long delays,
                                                      long x,
                                                      long y,
                                                      long z,
                                                      long channels_in_file,
                                                      int desired_channels)
        Unsafe version of: load_gif_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_load_gif_from_memory

        @Nullable
        public static java.nio.ByteBuffer stbi_load_gif_from_memory​(java.nio.ByteBuffer buffer,
                                                                    PointerBuffer delays,
                                                                    java.nio.IntBuffer x,
                                                                    java.nio.IntBuffer y,
                                                                    java.nio.IntBuffer z,
                                                                    java.nio.IntBuffer channels_in_file,
                                                                    int desired_channels)
        gif version of load_from_memory.
        Parameters:
        buffer - the buffer from which to load the image data
        delays - output the delays of each layer in the image
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        z - outputs the number of layers in the image
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_16

        public static long nstbi_load_16​(long filename,
                                         long x,
                                         long y,
                                         long channels_in_file,
                                         int desired_channels)
        Unsafe version of: load_16
      • stbi_load_16

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16​(java.nio.ByteBuffer filename,
                                                        java.nio.IntBuffer x,
                                                        java.nio.IntBuffer y,
                                                        java.nio.IntBuffer channels_in_file,
                                                        int desired_channels)
        
        @Nullable
        public static java.nio.ShortBuffer stbi_load_16​(java.lang.CharSequence filename,
                                                        java.nio.IntBuffer x,
                                                        java.nio.IntBuffer y,
                                                        java.nio.IntBuffer channels_in_file,
                                                        int desired_channels)
        
        16-bits-per-channel version of load.
        Parameters:
        filename - the file name
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_16_from_memory

        public static long nstbi_load_16_from_memory​(long buffer,
                                                     int len,
                                                     long x,
                                                     long y,
                                                     long channels_in_file,
                                                     int desired_channels)
        Unsafe version of: load_16_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_load_16_from_memory

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16_from_memory​(java.nio.ByteBuffer buffer,
                                                                    java.nio.IntBuffer x,
                                                                    java.nio.IntBuffer y,
                                                                    java.nio.IntBuffer channels_in_file,
                                                                    int desired_channels)
        In-memory version of load_16.
        Parameters:
        buffer - the buffer from which to load the image data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_load_16_from_callbacks

        public static long nstbi_load_16_from_callbacks​(long clbk,
                                                        long user,
                                                        long x,
                                                        long y,
                                                        long channels_in_file,
                                                        int desired_channels)
        Unsafe version of: load_16_from_callbacks
      • stbi_load_16_from_callbacks

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16_from_callbacks​(STBIIOCallbacks clbk,
                                                                       long user,
                                                                       java.nio.IntBuffer x,
                                                                       java.nio.IntBuffer y,
                                                                       java.nio.IntBuffer channels_in_file,
                                                                       int desired_channels)
        Callback version of load_16.
        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_loadf

        public static long nstbi_loadf​(long filename,
                                       long x,
                                       long y,
                                       long channels_in_file,
                                       int desired_channels)
        Unsafe version of: loadf
      • stbi_loadf

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf​(java.nio.ByteBuffer filename,
                                                      java.nio.IntBuffer x,
                                                      java.nio.IntBuffer y,
                                                      java.nio.IntBuffer channels_in_file,
                                                      int desired_channels)
        
        @Nullable
        public static java.nio.FloatBuffer stbi_loadf​(java.lang.CharSequence filename,
                                                      java.nio.IntBuffer x,
                                                      java.nio.IntBuffer y,
                                                      java.nio.IntBuffer channels_in_file,
                                                      int desired_channels)
        
        Floating-point version of load.
        Parameters:
        filename - the file name
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_loadf_from_memory

        public static long nstbi_loadf_from_memory​(long buffer,
                                                   int len,
                                                   long x,
                                                   long y,
                                                   long channels_in_file,
                                                   int desired_channels)
        Unsafe version of: loadf_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_loadf_from_memory

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf_from_memory​(java.nio.ByteBuffer buffer,
                                                                  java.nio.IntBuffer x,
                                                                  java.nio.IntBuffer y,
                                                                  java.nio.IntBuffer channels_in_file,
                                                                  int desired_channels)
        Floating-point version of load_from_memory.
        Parameters:
        buffer - the buffer from which to load the image data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • nstbi_loadf_from_callbacks

        public static long nstbi_loadf_from_callbacks​(long clbk,
                                                      long user,
                                                      long x,
                                                      long y,
                                                      long channels_in_file,
                                                      int desired_channels)
        Unsafe version of: loadf_from_callbacks
      • stbi_loadf_from_callbacks

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf_from_callbacks​(STBIIOCallbacks clbk,
                                                                     long user,
                                                                     java.nio.IntBuffer x,
                                                                     java.nio.IntBuffer y,
                                                                     java.nio.IntBuffer channels_in_file,
                                                                     int desired_channels)
        Floating-point version of load_from_callbacks.
        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        channels_in_file - outputs number of components in image
        desired_channels - 0 or 1..4 to force that many components per pixel. One of:
        01234
      • stbi_hdr_to_ldr_gamma

        public static void stbi_hdr_to_ldr_gamma​(float gamma)
        Changes the gamma value used when converting HDR images to LDR. The default value is 2.2f
        Parameters:
        gamma - the gamma value
      • stbi_hdr_to_ldr_scale

        public static void stbi_hdr_to_ldr_scale​(float scale)
        Changes the scale factor used when converting HDR images to LDR. The default value is 1.0f
        Parameters:
        scale - the scale factor
      • stbi_ldr_to_hdr_gamma

        public static void stbi_ldr_to_hdr_gamma​(float gamma)
        Changes the gamma value used when converting LDR images to HDR. The default value is 2.2f
        Parameters:
        gamma - the gamma value
      • stbi_ldr_to_hdr_scale

        public static void stbi_ldr_to_hdr_scale​(float scale)
        Changes the scale value used when converting LDR images to HDR. The default value is 1.0f
        Parameters:
        scale - the scale factor
      • nstbi_is_hdr

        public static int nstbi_is_hdr​(long filename)
        Unsafe version of: is_hdr
      • stbi_is_hdr

        public static boolean stbi_is_hdr​(java.nio.ByteBuffer filename)
        
        public static boolean stbi_is_hdr​(java.lang.CharSequence filename)
        
        Checks if the specified file contains an HDR image.
        Parameters:
        filename - the file name
        Returns:
        1 if the image is HDR, 0 otherwise
      • nstbi_is_hdr_from_memory

        public static int nstbi_is_hdr_from_memory​(long buffer,
                                                   int len)
        Unsafe version of: is_hdr_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_is_hdr_from_memory

        public static boolean stbi_is_hdr_from_memory​(java.nio.ByteBuffer buffer)
        In-memory version of is_hdr.
        Parameters:
        buffer - the buffer from which to load the image data
      • nstbi_is_hdr_from_callbacks

        public static int nstbi_is_hdr_from_callbacks​(long clbk,
                                                      long user)
        Unsafe version of: is_hdr_from_callbacks
      • stbi_is_hdr_from_callbacks

        public static boolean stbi_is_hdr_from_callbacks​(STBIIOCallbacks clbk,
                                                         long user)
        Callback version of is_hdr.
        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
      • nstbi_failure_reason

        public static long nstbi_failure_reason()
        Unsafe version of: failure_reason
      • stbi_failure_reason

        @Nullable
        public static java.lang.String stbi_failure_reason()
        Returns a brief reason for failure.
      • nstbi_image_free

        public static void nstbi_image_free​(long retval_from_stbi_load)
        Unsafe version of: image_free
      • stbi_image_free

        public static void stbi_image_free​(java.nio.ByteBuffer retval_from_stbi_load)
        
        public static void stbi_image_free​(java.nio.ShortBuffer retval_from_stbi_load)
        
        public static void stbi_image_free​(java.nio.FloatBuffer retval_from_stbi_load)
        
        Frees a loaded image
        Parameters:
        retval_from_stbi_load - an stb image
      • nstbi_info

        public static int nstbi_info​(long filename,
                                     long x,
                                     long y,
                                     long comp)
        Unsafe version of: info
      • stbi_info

        public static boolean stbi_info​(java.nio.ByteBuffer filename,
                                        java.nio.IntBuffer x,
                                        java.nio.IntBuffer y,
                                        java.nio.IntBuffer comp)
        
        public static boolean stbi_info​(java.lang.CharSequence filename,
                                        java.nio.IntBuffer x,
                                        java.nio.IntBuffer y,
                                        java.nio.IntBuffer comp)
        
        Returns image dimensions & components without fully decoding the image.
        Parameters:
        filename - the file name
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        comp - outputs number of components in image
        Returns:
        1 on success, 0 on failure
      • nstbi_info_from_memory

        public static int nstbi_info_from_memory​(long buffer,
                                                 int len,
                                                 long x,
                                                 long y,
                                                 long comp)
        Unsafe version of: info_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_info_from_memory

        public static boolean stbi_info_from_memory​(java.nio.ByteBuffer buffer,
                                                    java.nio.IntBuffer x,
                                                    java.nio.IntBuffer y,
                                                    java.nio.IntBuffer comp)
        In-memory version of info.
        Parameters:
        buffer - the buffer from which to load the image data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        comp - outputs number of components in image
      • nstbi_info_from_callbacks

        public static int nstbi_info_from_callbacks​(long clbk,
                                                    long user,
                                                    long x,
                                                    long y,
                                                    long comp)
        Unsafe version of: info_from_callbacks
      • stbi_info_from_callbacks

        public static boolean stbi_info_from_callbacks​(STBIIOCallbacks clbk,
                                                       long user,
                                                       java.nio.IntBuffer x,
                                                       java.nio.IntBuffer y,
                                                       java.nio.IntBuffer comp)
        Callback version of info.
        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        comp - outputs number of components in image
      • nstbi_is_16_bit

        public static int nstbi_is_16_bit​(long filename)
        Unsafe version of: is_16_bit
      • stbi_is_16_bit

        public static boolean stbi_is_16_bit​(java.nio.ByteBuffer filename)
        
        public static boolean stbi_is_16_bit​(java.lang.CharSequence filename)
        
        Returns true if the file contains a 16-bit image.
        Parameters:
        filename - the file name
      • nstbi_is_16_bit_from_memory

        public static int nstbi_is_16_bit_from_memory​(long buffer,
                                                      int len)
        Unsafe version of: is_16_bit_from_memory
        Parameters:
        len - the buffer length, in bytes
      • stbi_is_16_bit_from_memory

        public static boolean stbi_is_16_bit_from_memory​(java.nio.ByteBuffer buffer)
        In-memory version of is_16_bit.
        Parameters:
        buffer - the buffer from which to load the image data
      • nstbi_is_16_bit_from_callbacks

        public static int nstbi_is_16_bit_from_callbacks​(long clbk,
                                                         long user)
        Unsafe version of: is_16_bit_from_callbacks
      • stbi_is_16_bit_from_callbacks

        public static boolean stbi_is_16_bit_from_callbacks​(STBIIOCallbacks clbk,
                                                            long user)
        Callback version of is_16_bit.
        Parameters:
        clbk - an STBIIOCallbacks struct
        user - a pointer to user data
      • nstbi_set_unpremultiply_on_load

        public static void nstbi_set_unpremultiply_on_load​(int flag_true_if_should_unpremultiply)
        Unsafe version of: set_unpremultiply_on_load
      • stbi_set_unpremultiply_on_load

        public static void stbi_set_unpremultiply_on_load​(boolean flag_true_if_should_unpremultiply)
        For image formats that explicitly notate that they have premultiplied alpha, we just return the colors as stored in the file. Set this flag to force unpremultiplication. Results are undefined if the unpremultiply overflows.
        Parameters:
        flag_true_if_should_unpremultiply - the unpremultiply flag
      • nstbi_convert_iphone_png_to_rgb

        public static void nstbi_convert_iphone_png_to_rgb​(int flag_true_if_should_convert)
        Unsafe version of: convert_iphone_png_to_rgb
      • stbi_convert_iphone_png_to_rgb

        public static void stbi_convert_iphone_png_to_rgb​(boolean flag_true_if_should_convert)
        Indicate whether we should process iPhone images back to canonical format, or just pass them through "as-is".
        Parameters:
        flag_true_if_should_convert - the convert iPhone PNG to RGB flag
      • nstbi_set_flip_vertically_on_load

        public static void nstbi_set_flip_vertically_on_load​(int flag_true_if_should_flip)
        Unsafe version of: set_flip_vertically_on_load
      • stbi_set_flip_vertically_on_load

        public static void stbi_set_flip_vertically_on_load​(boolean flag_true_if_should_flip)
        Flips the image vertically, so the first pixel in the output array is the bottom left.
        Parameters:
        flag_true_if_should_flip - the flip vertically on load flag
      • nstbi_zlib_decode_malloc_guesssize

        public static long nstbi_zlib_decode_malloc_guesssize​(long buffer,
                                                              int len,
                                                              int initial_size,
                                                              long outlen)
        Unsafe version of: zlib_decode_malloc_guesssize
      • stbi_zlib_decode_malloc_guesssize

        @Nullable
        public static java.nio.ByteBuffer stbi_zlib_decode_malloc_guesssize​(java.nio.ByteBuffer buffer,
                                                                            int initial_size)
        ZLIB client - used by PNG, available for other purposes
      • nstbi_zlib_decode_malloc_guesssize_headerflag

        public static long nstbi_zlib_decode_malloc_guesssize_headerflag​(long buffer,
                                                                         int len,
                                                                         int initial_size,
                                                                         long outlen,
                                                                         int parse_header)
      • stbi_zlib_decode_malloc_guesssize_headerflag

        @Nullable
        public static java.nio.ByteBuffer stbi_zlib_decode_malloc_guesssize_headerflag​(java.nio.ByteBuffer buffer,
                                                                                       int initial_size,
                                                                                       boolean parse_header)
        ZLIB client - used by PNG, available for other purposes
      • nstbi_zlib_decode_malloc

        public static long nstbi_zlib_decode_malloc​(long buffer,
                                                    int len,
                                                    long outlen)
        Unsafe version of: zlib_decode_malloc
      • stbi_zlib_decode_malloc

        @Nullable
        public static java.nio.ByteBuffer stbi_zlib_decode_malloc​(java.nio.ByteBuffer buffer)
        ZLIB client - used by PNG, available for other purposes
      • nstbi_zlib_decode_buffer

        public static int nstbi_zlib_decode_buffer​(long obuffer,
                                                   int olen,
                                                   long ibuffer,
                                                   int ilen)
        Unsafe version of: zlib_decode_buffer
      • stbi_zlib_decode_buffer

        public static int stbi_zlib_decode_buffer​(java.nio.ByteBuffer obuffer,
                                                  java.nio.ByteBuffer ibuffer)
        ZLIB client - used by PNG, available for other purposes
      • nstbi_zlib_decode_noheader_malloc

        public static long nstbi_zlib_decode_noheader_malloc​(long buffer,
                                                             int len,
                                                             long outlen)
        Unsafe version of: zlib_decode_noheader_malloc
      • stbi_zlib_decode_noheader_malloc

        @Nullable
        public static java.nio.ByteBuffer stbi_zlib_decode_noheader_malloc​(java.nio.ByteBuffer buffer)
        ZLIB client - used by PNG, available for other purposes
      • nstbi_zlib_decode_noheader_buffer

        public static int nstbi_zlib_decode_noheader_buffer​(long obuffer,
                                                            int olen,
                                                            long ibuffer,
                                                            int ilen)
        Unsafe version of: zlib_decode_noheader_buffer
      • stbi_zlib_decode_noheader_buffer

        public static int stbi_zlib_decode_noheader_buffer​(java.nio.ByteBuffer obuffer,
                                                           java.nio.ByteBuffer ibuffer)
        ZLIB client - used by PNG, available for other purposes
      • stbi_load

        @Nullable
        public static java.nio.ByteBuffer stbi_load​(java.nio.ByteBuffer filename,
                                                    int[] x,
                                                    int[] y,
                                                    int[] channels_in_file,
                                                    int desired_channels)
        
        @Nullable
        public static java.nio.ByteBuffer stbi_load​(java.lang.CharSequence filename,
                                                    int[] x,
                                                    int[] y,
                                                    int[] channels_in_file,
                                                    int desired_channels)
        
        Array version of: load
      • stbi_load_from_memory

        @Nullable
        public static java.nio.ByteBuffer stbi_load_from_memory​(java.nio.ByteBuffer buffer,
                                                                int[] x,
                                                                int[] y,
                                                                int[] channels_in_file,
                                                                int desired_channels)
        Array version of: load_from_memory
      • stbi_load_from_callbacks

        @Nullable
        public static java.nio.ByteBuffer stbi_load_from_callbacks​(STBIIOCallbacks clbk,
                                                                   long user,
                                                                   int[] x,
                                                                   int[] y,
                                                                   int[] channels_in_file,
                                                                   int desired_channels)
        Array version of: load_from_callbacks
      • stbi_load_gif_from_memory

        @Nullable
        public static java.nio.ByteBuffer stbi_load_gif_from_memory​(java.nio.ByteBuffer buffer,
                                                                    PointerBuffer delays,
                                                                    int[] x,
                                                                    int[] y,
                                                                    int[] z,
                                                                    int[] channels_in_file,
                                                                    int desired_channels)
        Array version of: load_gif_from_memory
      • stbi_load_16

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16​(java.nio.ByteBuffer filename,
                                                        int[] x,
                                                        int[] y,
                                                        int[] channels_in_file,
                                                        int desired_channels)
        
        @Nullable
        public static java.nio.ShortBuffer stbi_load_16​(java.lang.CharSequence filename,
                                                        int[] x,
                                                        int[] y,
                                                        int[] channels_in_file,
                                                        int desired_channels)
        
        Array version of: load_16
      • stbi_load_16_from_memory

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16_from_memory​(java.nio.ByteBuffer buffer,
                                                                    int[] x,
                                                                    int[] y,
                                                                    int[] channels_in_file,
                                                                    int desired_channels)
        Array version of: load_16_from_memory
      • stbi_load_16_from_callbacks

        @Nullable
        public static java.nio.ShortBuffer stbi_load_16_from_callbacks​(STBIIOCallbacks clbk,
                                                                       long user,
                                                                       int[] x,
                                                                       int[] y,
                                                                       int[] channels_in_file,
                                                                       int desired_channels)
        Array version of: load_16_from_callbacks
      • stbi_loadf

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf​(java.nio.ByteBuffer filename,
                                                      int[] x,
                                                      int[] y,
                                                      int[] channels_in_file,
                                                      int desired_channels)
        
        @Nullable
        public static java.nio.FloatBuffer stbi_loadf​(java.lang.CharSequence filename,
                                                      int[] x,
                                                      int[] y,
                                                      int[] channels_in_file,
                                                      int desired_channels)
        
        Array version of: loadf
      • stbi_loadf_from_memory

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf_from_memory​(java.nio.ByteBuffer buffer,
                                                                  int[] x,
                                                                  int[] y,
                                                                  int[] channels_in_file,
                                                                  int desired_channels)
        Array version of: loadf_from_memory
      • stbi_loadf_from_callbacks

        @Nullable
        public static java.nio.FloatBuffer stbi_loadf_from_callbacks​(STBIIOCallbacks clbk,
                                                                     long user,
                                                                     int[] x,
                                                                     int[] y,
                                                                     int[] channels_in_file,
                                                                     int desired_channels)
        Array version of: loadf_from_callbacks
      • stbi_info

        public static boolean stbi_info​(java.nio.ByteBuffer filename,
                                        int[] x,
                                        int[] y,
                                        int[] comp)
        
        public static boolean stbi_info​(java.lang.CharSequence filename,
                                        int[] x,
                                        int[] y,
                                        int[] comp)
        
        Array version of: info
      • stbi_info_from_memory

        public static boolean stbi_info_from_memory​(java.nio.ByteBuffer buffer,
                                                    int[] x,
                                                    int[] y,
                                                    int[] comp)
        Array version of: info_from_memory
      • stbi_info_from_callbacks

        public static boolean stbi_info_from_callbacks​(STBIIOCallbacks clbk,
                                                       long user,
                                                       int[] x,
                                                       int[] y,
                                                       int[] comp)
        Array version of: info_from_callbacks