Beispiel #1
0
 /**
  * Create GLImage from image file bytes (the contents of a jpg, gif or png file). Flip Y axis.
  *
  * @param pixels
  * @param w
  * @param h
  */
 public GLImage(byte[] bytes) {
   BufferedImage img = makeBufferedImage(bytes);
   if (makeGLImage(img, true, false)) {
     GLApp.msg("GLImage(byte[]): loaded image from bytes[" + bytes.length + "]");
   } else {
     GLApp.err("GLImage(byte[]): could not create Image from bytes[" + bytes.length + "]");
   }
 }
Beispiel #2
0
 /**
  * Create GLImage from image file bytes (the contents of a jpg, gif or png file).
  *
  * @param pixels
  * @param w
  * @param h
  */
 public GLImage(byte[] bytes, boolean flipYaxis, boolean convertPow2) {
   BufferedImage img = makeBufferedImage(bytes);
   if (makeGLImage(img, flipYaxis, convertPow2)) {
     GLApp.msg("GLImage(byte[],bool,bool): loaded image from bytes[" + bytes.length + "]");
   } else {
     GLApp.err(
         "GLImage(byte[],bool,bool): could not create Image from bytes[" + bytes.length + "]");
   }
 }
Beispiel #3
0
 /**
  * Load pixels from an image file. Convert to RGBA format.
  *
  * @param imgName
  */
 public GLImage(String imgName, boolean flipYaxis, boolean convertPow2) {
   BufferedImage img = loadJavaImage(imgName);
   if (makeGLImage(img, flipYaxis, convertPow2)) {
     GLApp.msg("GLImage(String,bool,bool): loaded " + imgName + ", width=" + w + " height=" + h);
   }
 }
Beispiel #4
0
 /**
  * Load pixels from an image file. Flip Y axis. Convert to RGBA format.
  *
  * @param imgName
  */
 public GLImage(String imgName) {
   BufferedImage img = loadJavaImage(imgName);
   if (makeGLImage(img, true, false)) {
     GLApp.msg("GLImage(String): loaded " + imgName + ", width=" + w + " height=" + h);
   }
 }