
org.lwjgl.stb.STBIWriteCallbackI Maven / Gradle / Ivy
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.stb;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* Instances of this interface may be used with the {@link STBImageWrite} {@code write_type_to_func} functions.
*
* Type
*
*
* void (*{@link #invoke}) (
* void *context,
* void *data,
* int size
* )
*/
@FunctionalInterface
@NativeType("stbi_write_func *")
public interface STBIWriteCallbackI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer, ffi_type_pointer, ffi_type_sint32
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE)),
memGetInt(memGetAddress(args + 2 * POINTER_SIZE))
);
}
/**
* The {@code stbi_write_func} callback.
*
* @param context the context passed to the write function
* @param data the data to write
* @param size the number of bytes in {@code data}
*/
void invoke(@NativeType("void *") long context, @NativeType("void *") long data, int size);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy