Package org.lwjgl.stb

Class STBIIOCallbacks

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class STBIIOCallbacks
    extends Struct
    implements NativeResource
    Image IO callbacks, used by load_from_callbacks.

    Member documentation

    • read – fill data with size bytes. Return number of bytes actually read.
    • skip – skip the next n bytes, or unget the last -n bytes if negative
    • eof – returns nonzero if we are at end of file/data

    Layout

    
     struct stbi_io_callbacks {
         int (*read) (void *user, char *data, int size);
         void (*skip) (void *user, int n);
         int (*eof) (void *user);
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • READ, SKIP, EOF

        The struct member offsets.
    • Constructor Detail

      • STBIIOCallbacks

        public STBIIOCallbacks​(java.nio.ByteBuffer container)
        Creates a STBIIOCallbacks instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.