/** * 16-bits-per-channel version of {@link #stbi_load load}. * * @param filename the file name * @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(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { if (CHECKS) { checkNT1(filename); check(x, 1); check(y, 1); check(channels_in_file, 1); } long __result = nstbi_load_16(memAddress(filename), 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()))); }
/** * 16-bits-per-channel version of {@link #stbi_load load}. * * @param filename the file name * @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(@NativeType("char const *") CharSequence filename, @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); } MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { stack.nASCII(filename, true); long filenameEncoded = stack.getPointerAddress(); long __result = nstbi_load_16(filenameEncoded, 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()))); } finally { stack.setPointer(stackPointer); } }
/** Array version of: {@link #stbi_load_16 load_16} */ @Nullable @NativeType("stbi_us *") public static ShortBuffer stbi_load_16(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { if (CHECKS) { checkNT1(filename); check(x, 1); check(y, 1); check(channels_in_file, 1); } long __result = nstbi_load_16(memAddress(filename), x, y, channels_in_file, desired_channels); return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); }
/** Array version of: {@link #stbi_load_16 load_16} */ @Nullable @NativeType("stbi_us *") public static ShortBuffer stbi_load_16(@NativeType("char const *") CharSequence filename, @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); } MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { stack.nASCII(filename, true); long filenameEncoded = stack.getPointerAddress(); long __result = nstbi_load_16(filenameEncoded, x, y, channels_in_file, desired_channels); return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); } finally { stack.setPointer(stackPointer); } }