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-bit-per-channel (16 bpc not supported)
    • 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 16-bit-per-channel PNG
    • no 12-bit-per-channel JPEG
    • no JPEGs with arithmetic coding
    • no 1-bit BMP
    • 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 Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      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".
      static java.lang.String stbi_failure_reason()
      Returns a brief reason for failure.
      static void stbi_hdr_to_ldr_gamma(float gamma)
      Changes the gamma value used when converting HDR images to LDR.
      static void stbi_hdr_to_ldr_scale(float scale)
      Changes the scale factor used when converting HDR images to LDR.
      static void stbi_image_free(java.nio.ByteBuffer retval_from_stbi_load)
      Frees a loaded image
      static void stbi_image_free(java.nio.FloatBuffer retval_from_stbi_load)
      Frees a loaded image
      static boolean stbi_info_from_callbacks(STBIIOCallbacks clbk, long user, int[] x, int[] y, int[] comp)
      Array version of: info_from_callbacks
      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.
      static boolean stbi_info_from_memory(java.nio.ByteBuffer buffer, int[] x, int[] y, int[] comp)
      Array version of: info_from_memory
      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.
      static boolean stbi_info(java.nio.ByteBuffer filename, int[] x, int[] y, int[] comp)
      Array version of: info
      static boolean stbi_info(java.nio.ByteBuffer filename, java.nio.IntBuffer x, java.nio.IntBuffer y, java.nio.IntBuffer comp)
      Returns image dimensions & components without fully decoding the image.
      static boolean stbi_info(java.lang.CharSequence filename, int[] x, int[] y, int[] comp)
      Array version of: info
      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.
      static boolean stbi_is_hdr_from_callbacks(STBIIOCallbacks clbk, long user)
      Callback version of is_hdr.
      static boolean stbi_is_hdr_from_memory(java.nio.ByteBuffer buffer)
      In-memory version of is_hdr.
      static boolean stbi_is_hdr(java.nio.ByteBuffer filename)
      Checks if the specified file contains an HDR image.
      static boolean stbi_is_hdr(java.lang.CharSequence filename)
      Checks if the specified file contains an HDR image.
      static void stbi_ldr_to_hdr_gamma(float gamma)
      Changes the gamma value used when converting LDR images to HDR.
      static void stbi_ldr_to_hdr_scale(float scale)
      Changes the scale value used when converting LDR images to HDR.
      static java.nio.ShortBuffer stbi_load_16(java.nio.ByteBuffer filename, int[] x, int[] y, int[] channels_in_file, int desired_channels)
      Array version of: load_16
      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)
      16-bits-per-channel version of load.
      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
      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.
      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
      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.
      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
      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.
      static java.nio.ByteBuffer stbi_load(java.nio.ByteBuffer filename, int[] x, int[] y, int[] channels_in_file, int desired_channels)
      Array version of: load
      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)
      Loads an image from the specified file.
      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
      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.
      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
      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.
      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
      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.
      static java.nio.FloatBuffer stbi_loadf(java.nio.ByteBuffer filename, int[] x, int[] y, int[] channels_in_file, int desired_channels)
      Array version of: loadf
      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)
      Floating-point version of load.
      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
      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.
      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.
      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.
      static int stbi_zlib_decode_buffer(java.nio.ByteBuffer obuffer, java.nio.ByteBuffer ibuffer)
      ZLIB client - used by PNG, available for other purposes
      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
      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
      static java.nio.ByteBuffer stbi_zlib_decode_malloc(java.nio.ByteBuffer buffer)
      ZLIB client - used by PNG, available for other purposes
      static int stbi_zlib_decode_noheader_buffer(java.nio.ByteBuffer obuffer, java.nio.ByteBuffer ibuffer)
      ZLIB client - used by PNG, available for other purposes
      static java.nio.ByteBuffer stbi_zlib_decode_noheader_malloc(java.nio.ByteBuffer buffer)
      ZLIB client - used by PNG, available for other purposes
      • Methods inherited from class java.lang.Object

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

      • stbi_load

        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)
        
        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
      • stbi_load_from_memory

        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
      • stbi_load_from_callbacks

        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
      • stbi_load_16

        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)
        
        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
      • stbi_loadf

        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)
        
        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
      • stbi_loadf_from_memory

        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
      • stbi_loadf_from_callbacks

        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
      • 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
      • 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 read the image data
      • 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
      • stbi_failure_reason

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

        public static void stbi_image_free(java.nio.ByteBuffer 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
      • 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
      • 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 read the image data
        x - outputs the image width in pixels
        y - outputs the image height in pixels
        comp - outputs number of components in image
      • 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
      • 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
      • 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
      • 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
      • stbi_zlib_decode_malloc_guesssize

        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
        Parameters:
        buffer -
        initial_size -
      • stbi_zlib_decode_malloc_guesssize_headerflag

        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
        Parameters:
        buffer -
        initial_size -
        parse_header -
      • stbi_zlib_decode_malloc

        public static java.nio.ByteBuffer stbi_zlib_decode_malloc(java.nio.ByteBuffer buffer)
        ZLIB client - used by PNG, available for other purposes
        Parameters:
        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
        Parameters:
        obuffer -
        ibuffer -
      • stbi_zlib_decode_noheader_malloc

        public static java.nio.ByteBuffer stbi_zlib_decode_noheader_malloc(java.nio.ByteBuffer buffer)
        ZLIB client - used by PNG, available for other purposes
        Parameters:
        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
        Parameters:
        obuffer -
        ibuffer -
      • stbi_load

        public static java.nio.ByteBuffer stbi_load(java.nio.ByteBuffer filename,
                                                    int[] x,
                                                    int[] y,
                                                    int[] channels_in_file,
                                                    int desired_channels)
        
        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

        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

        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_16

        public static java.nio.ShortBuffer stbi_load_16(java.nio.ByteBuffer filename,
                                                        int[] x,
                                                        int[] y,
                                                        int[] channels_in_file,
                                                        int desired_channels)
        
        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_loadf

        public static java.nio.FloatBuffer stbi_loadf(java.nio.ByteBuffer filename,
                                                      int[] x,
                                                      int[] y,
                                                      int[] channels_in_file,
                                                      int desired_channels)
        
        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

        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

        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