示例#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 + "]");
   }
 }
示例#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 + "]");
   }
 }
示例#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);
   }
 }
示例#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);
   }
 }