コード例 #1
0
ファイル: STBImage.java プロジェクト: stkromm/vine-engine
 /**
  * Floating-point 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 comp outputs number of components in image
  * @param req_comp 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>
  */
 public static FloatBuffer stbi_loadf(
     ByteBuffer filename, IntBuffer x, IntBuffer y, IntBuffer comp, int req_comp) {
   if (CHECKS) {
     checkNT1(filename);
     checkBuffer(x, 1);
     checkBuffer(y, 1);
     checkBuffer(comp, 1);
   }
   long __result =
       nstbi_loadf(memAddress(filename), memAddress(x), memAddress(y), memAddress(comp), req_comp);
   return memFloatBuffer(
       __result, x.get(x.position()) * y.get(y.position()) * comp.get(comp.position()));
 }
コード例 #2
0
ファイル: STBImage.java プロジェクト: stkromm/vine-engine
 /**
  * Floating-point version of {@link #stbi_load_from_callbacks load_from_callbacks}.
  *
  * @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 comp outputs number of components in image
  * @param req_comp 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>
  */
 public static FloatBuffer stbi_loadf_from_callbacks(
     STBIIOCallbacks clbk, long user, IntBuffer x, IntBuffer y, IntBuffer comp, int req_comp) {
   if (CHECKS) {
     checkBuffer(x, 1);
     checkBuffer(y, 1);
     checkBuffer(comp, 1);
     STBIIOCallbacks.validate(clbk.address());
   }
   long __result =
       nstbi_loadf_from_callbacks(
           clbk.address(), user, memAddress(x), memAddress(y), memAddress(comp), req_comp);
   return memFloatBuffer(
       __result, x.get(x.position()) * y.get(y.position()) * comp.get(comp.position()));
 }
コード例 #3
0
ファイル: STBImage.java プロジェクト: stkromm/vine-engine
 /**
  * Floating-point version of {@link #stbi_load_from_memory load_from_memory}.
  *
  * @param buffer the buffer from which to load the image data
  * @param x outputs the image width in pixels
  * @param y outputs the image height in pixels
  * @param comp outputs number of components in image
  * @param req_comp 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>
  */
 public static FloatBuffer stbi_loadf_from_memory(
     ByteBuffer buffer, IntBuffer x, IntBuffer y, IntBuffer comp, int req_comp) {
   if (CHECKS) {
     checkBuffer(x, 1);
     checkBuffer(y, 1);
     checkBuffer(comp, 1);
   }
   long __result =
       nstbi_loadf_from_memory(
           memAddress(buffer),
           buffer.remaining(),
           memAddress(x),
           memAddress(y),
           memAddress(comp),
           req_comp);
   return memFloatBuffer(
       __result, x.get(x.position()) * y.get(y.position()) * comp.get(comp.position()));
 }
コード例 #4
0
ファイル: STBImage.java プロジェクト: stkromm/vine-engine
 /**
  * Floating-point 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 comp outputs number of components in image
  * @param req_comp 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>
  */
 public static FloatBuffer stbi_loadf(
     CharSequence filename, IntBuffer x, IntBuffer y, IntBuffer comp, int req_comp) {
   if (CHECKS) {
     checkBuffer(x, 1);
     checkBuffer(y, 1);
     checkBuffer(comp, 1);
   }
   MemoryStack stack = stackGet();
   int stackPointer = stack.getPointer();
   try {
     ByteBuffer filenameEncoded = stack.ASCII(filename);
     long __result =
         nstbi_loadf(
             memAddress(filenameEncoded),
             memAddress(x),
             memAddress(y),
             memAddress(comp),
             req_comp);
     return memFloatBuffer(
         __result, x.get(x.position()) * y.get(y.position()) * comp.get(comp.position()));
   } finally {
     stack.setPointer(stackPointer);
   }
 }