Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Pixmap.drawPixmap()


        ByteBuffer[] icons = new ByteBuffer[config.iconPaths.size];
        for (int i = 0, n = config.iconPaths.size; i < n; i++) {
          Pixmap pixmap = new Pixmap(Gdx.files.getFileHandle(config.iconPaths.get(i), config.iconFileTypes.get(i)));
          if (pixmap.getFormat() != Format.RGBA8888) {
            Pixmap rgba = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGBA8888);
            rgba.drawPixmap(pixmap, 0, 0);
            pixmap = rgba;
          }
          icons[i] = ByteBuffer.allocateDirect(pixmap.getPixels().limit());
          icons[i].put(pixmap.getPixels()).flip();
          pixmap.dispose();
View Full Code Here


        ByteBuffer[] icons = new ByteBuffer[config.iconPaths.size];
        for (int i = 0, n = config.iconPaths.size; i < n; i++) {
          Pixmap pixmap = new Pixmap(Gdx.files.getFileHandle(config.iconPaths.get(i), config.iconFileTypes.get(i)));
          if (pixmap.getFormat() != Format.RGBA8888) {
            Pixmap rgba = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGBA8888);
            rgba.drawPixmap(pixmap, 0, 0);
            pixmap = rgba;
          }
          icons[i] = ByteBuffer.allocateDirect(pixmap.getPixels().limit());
          icons[i].put(pixmap.getPixels()).flip();
          pixmap.dispose();
View Full Code Here

      Pixmap pixmap = new Pixmap(getWidth(), getRows(), Format.Alpha);
      BufferUtils.copy(getBuffer(), pixmap.getPixels(), pixmap.getPixels().capacity());
      Pixmap converted = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), format);
      Blending blending = Pixmap.getBlending();
      Pixmap.setBlending(Blending.None);
      converted.drawPixmap(pixmap, 0, 0);
      Pixmap.setBlending(blending);
      pixmap.dispose();
      return converted;
    }
   
View Full Code Here

      int pixmapHeight = pixmap.getHeight();
      int potWidth = MathUtils.nextPowerOfTwo(pixmapWidth);
      int potHeight = MathUtils.nextPowerOfTwo(pixmapHeight);
      if (pixmapWidth != potWidth || pixmapHeight != potHeight) {
        Pixmap tmp = new Pixmap(potWidth, potHeight, pixmap.getFormat());
        tmp.drawPixmap(pixmap, 0, 0, 0, 0, pixmapWidth, pixmapHeight);
        pixmap.dispose();
        return tmp;
      }
    }
    return pixmap;
View Full Code Here

      int pixmapHeight = pixmap.getHeight();
      int potWidth = MathUtils.nextPowerOfTwo(pixmapWidth);
      int potHeight = MathUtils.nextPowerOfTwo(pixmapHeight);
      if (pixmapWidth != potWidth || pixmapHeight != potHeight) {
        Pixmap tmp = new Pixmap(potWidth, potHeight, pixmap.getFormat());
        tmp.drawPixmap(pixmap, 0, 0, 0, 0, pixmapWidth, pixmapHeight);
        pixmap.dispose();
        return tmp;
      }
    }
    return pixmap;
View Full Code Here

      System.out.println("Processing " + entry.inputFile);
      Pixmap pixmap = new Pixmap(new FileHandle(entry.inputFile));
      if (pixmap.getFormat() != Format.RGB888 && pixmap.getFormat() != Format.RGB565) {
        System.out.println("Converting from " + pixmap.getFormat() + " to RGB888!");
        Pixmap tmp = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGB888);
        tmp.drawPixmap(pixmap, 0, 0, 0, 0, pixmap.getWidth(), pixmap.getHeight());
        pixmap.dispose();
        pixmap = tmp;
      }
      ETC1.encodeImagePKM(pixmap).write(new FileHandle(entry.outputFile));
      pixmap.dispose();
View Full Code Here

        ByteBuffer[] icons = new ByteBuffer[config.iconPaths.size];
        for (int i = 0, n = config.iconPaths.size; i < n; i++) {
          Pixmap pixmap = new Pixmap(Gdx.files.getFileHandle(config.iconPaths.get(i), config.iconFileTypes.get(i)));
          if (pixmap.getFormat() != Format.RGBA8888) {
            Pixmap rgba = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGBA8888);
            rgba.drawPixmap(pixmap, 0, 0);
            pixmap = rgba;
          }
          icons[i] = ByteBuffer.allocateDirect(pixmap.getPixels().limit());
          icons[i].put(pixmap.getPixels()).flip();
          pixmap.dispose();
View Full Code Here

        ByteBuffer[] icons = new ByteBuffer[config.iconPaths.size];
        for (int i = 0, n = config.iconPaths.size; i < n; i++) {
          Pixmap pixmap = new Pixmap(Gdx.files.getFileHandle(config.iconPaths.get(i), config.iconFileTypes.get(i)));
          if (pixmap.getFormat() != Format.RGBA8888) {
            Pixmap rgba = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGBA8888);
            rgba.drawPixmap(pixmap, 0, 0);
            pixmap = rgba;
          }
          icons[i] = ByteBuffer.allocateDirect(pixmap.getPixels().limit());
          icons[i].put(pixmap.getPixels()).flip();
          pixmap.dispose();
View Full Code Here

        ByteBuffer[] icons = new ByteBuffer[config.iconPaths.size];
        for (int i = 0, n = config.iconPaths.size; i < n; i++) {
          Pixmap pixmap = new Pixmap(Gdx.files.getFileHandle(config.iconPaths.get(i), config.iconFileTypes.get(i)));
          if (pixmap.getFormat() != Format.RGBA8888) {
            Pixmap rgba = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGBA8888);
            rgba.drawPixmap(pixmap, 0, 0);
            pixmap = rgba;
          }
          icons[i] = ByteBuffer.allocateDirect(pixmap.getPixels().limit());
          icons[i].put(pixmap.getPixels()).flip();
          pixmap.dispose();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.