/** * Callback version of {@link #stbi_load_16 load_16}. * * @param clbk an {@link STBIIOCallbacks} struct * @param user a pointer to user data * @param x outputs the image width in pixels * @param y outputs the image height in pixels * @param channels_in_file outputs number of components in image * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:<br><table><tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td></tr></table> */ @Nullable @NativeType("stbi_us *") public static ShortBuffer stbi_load_16_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { if (CHECKS) { check(x, 1); check(y, 1); check(channels_in_file, 1); STBIIOCallbacks.validate(clbk.address()); } long __result = nstbi_load_16_from_callbacks(clbk.address(), user, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); return memShortBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); }
/** Array version of: {@link #stbi_load_16_from_callbacks load_16_from_callbacks} */ @Nullable @NativeType("stbi_us *") public static ShortBuffer stbi_load_16_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { if (CHECKS) { check(x, 1); check(y, 1); check(channels_in_file, 1); STBIIOCallbacks.validate(clbk.address()); } long __result = nstbi_load_16_from_callbacks(clbk.address(), user, x, y, channels_in_file, desired_channels); return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); }