Package org.newdawn.slick.opengl

Examples of org.newdawn.slick.opengl.ImageData


    realWidth = width = data.getWidth();
    realHeight = height = data.getHeight();
   
    if ((dataWidth <= tileSize) && (dataHeight <= tileSize)) {
      images = new Image[1][1];
      ImageData tempData = new ImageData() {
        public int getDepth() {
          return data.getDepth();
        }

        public int getHeight() {
          return dataHeight;
        }

        public ByteBuffer getImageBufferData() {
          return imageBuffer;
        }

        public int getTexHeight() {
          return dataHeight;
        }

        public int getTexWidth() {
          return dataWidth;
        }

        public int getWidth() {
          return dataWidth;
        }
      };
      images[0][0] = new Image(tempData, filter);
      xcount = 1;
      ycount = 1;
      inited = true;
      return;
    }
   
    xcount = ((realWidth-1) / tileSize) + 1;
    ycount = ((realHeight-1) / tileSize) + 1;
   
    images = new Image[xcount][ycount];
    int components = data.getDepth() / 8;
   
    for (int x=0;x<xcount;x++) {
      for (int y=0;y<ycount;y++) {
        int finalX = ((x+1) * tileSize);
        int finalY = ((y+1) * tileSize);
        final int imageWidth = Math.min((realWidth - (x*tileSize)), tileSize);
        final int imageHeight = Math.min((realHeight - (y*tileSize)), tileSize);
       
        final int xSize = tileSize;
        final int ySize = tileSize;
       
        final ByteBuffer subBuffer = BufferUtils.createByteBuffer(tileSize*tileSize*components);
        int xo = x*tileSize*components;

        byte[] byteData = new byte[xSize*components];
        for (int i=0;i<ySize;i++) {
          int yo = (((y * tileSize) + i) * dataWidth) * components;
          imageBuffer.position(yo+xo);
         
          imageBuffer.get(byteData, 0, xSize*components);
          subBuffer.put(byteData);
        }
       
        subBuffer.flip();
        ImageData imgData = new ImageData() {
          public int getDepth() {
            return data.getDepth();
          }

          public int getHeight() {
View Full Code Here


      realWidth = width = data.getWidth();
      realHeight = height = data.getHeight();
     
      if ((dataWidth <= tileSize) && (dataHeight <= tileSize)) {
        images = new Image[1][1];
        ImageData tempData = new ImageData() {
          public int getDepth() {
            return data.getDepth();
          }

          public int getHeight() {
            return dataHeight;
          }

          public ByteBuffer getImageBufferData() {
            return imageBuffer;
          }

          public int getTexHeight() {
            return dataHeight;
          }

          public int getTexWidth() {
            return dataWidth;
          }

          public int getWidth() {
            return dataWidth;
          }
        };
        images[0][0] = new Image(tempData, filter);
        xcount = 1;
        ycount = 1;
        inited = true;
        return;
      }
     
      xcount = ((dataWidth-1) / tileSize) + 1;
      ycount = ((dataHeight-1) / tileSize) + 1;
     
      images = new Image[xcount][ycount];
      int components = data.getDepth() / 8;
     
      for (int x=0;x<xcount;x++) {
        for (int y=0;y<ycount;y++) {
          final int xSize = tileSize;
          final int ySize = tileSize;
         
          final ByteBuffer subBuffer = BufferUtils.createByteBuffer(tileSize*tileSize*components);
          int xo = x*tileSize*components;
 
          byte[] byteData = new byte[xSize*components];
          for (int i=0;i<ySize;i++) {
            int yo = (((y * tileSize) + i) * dataWidth) * components;
            imageBuffer.position(yo+xo);
           
            imageBuffer.get(byteData, 0, xSize*components);
            subBuffer.put(byteData);
          }
         
          int finalX = ((x) * tileSize);
          int finalY = ((y) * tileSize);
          final int imageWidth = realWidth < finalX ? realWidth % tileSize : tileSize;
          final int imageHeight = realHeight < finalY ? realHeight % tileSize : tileSize;
         
          subBuffer.flip();
          ImageData imgData = new ImageData() {
            public int getDepth() {
              return data.getDepth();
            }
 
            public int getHeight() {
View Full Code Here

    realWidth = width = data.getWidth();
    realHeight = height = data.getHeight();
   
    if ((dataWidth <= tileSize) && (dataHeight <= tileSize)) {
      images = new Image[1][1];
      ImageData tempData = new ImageData() {
        public int getDepth() {
          return data.getDepth();
        }

        public int getHeight() {
          return dataHeight;
        }

        public ByteBuffer getImageBufferData() {
          return imageBuffer;
        }

        public int getTexHeight() {
          return dataHeight;
        }

        public int getTexWidth() {
          return dataWidth;
        }

        public int getWidth() {
          return dataWidth;
        }
      };
      images[0][0] = new Image(tempData, filter);
      xcount = 1;
      ycount = 1;
      inited = true;
      return;
    }
   
    xcount = ((realWidth-1) / tileSize) + 1;
    ycount = ((realHeight-1) / tileSize) + 1;
   
    images = new Image[xcount][ycount];
    int components = data.getDepth() / 8;
   
    for (int x=0;x<xcount;x++) {
      for (int y=0;y<ycount;y++) {
        int finalX = ((x+1) * tileSize);
        int finalY = ((y+1) * tileSize);
        final int imageWidth = tileSize;
        final int imageHeight = tileSize;
       
        final int xSize = Math.min(dataWidth, imageWidth);
        final int ySize = Math.min(dataHeight, imageHeight);
       
        final ByteBuffer subBuffer = BufferUtils.createByteBuffer(tileSize*tileSize*components);
        int xo = x*tileSize*components;

        byte[] byteData = new byte[xSize*components];
        for (int i=0;i<ySize;i++) {
          int yo = (((y * tileSize) + i) * dataWidth) * components;
          imageBuffer.position(yo+xo);
         
          imageBuffer.get(byteData, 0, xSize*components);
          subBuffer.put(byteData);
        }
       
        subBuffer.flip();
        ImageData imgData = new ImageData() {
          public int getDepth() {
            return data.getDepth();
          }

          public int getHeight() {
View Full Code Here

    realWidth = width = data.getWidth();
    realHeight = height = data.getHeight();
   
    if ((dataWidth <= tileSize) && (dataHeight <= tileSize)) {
      images = new Image[1][1];
      ImageData tempData = new ImageData() {
        public int getDepth() {
          return data.getDepth();
        }

        public int getHeight() {
          return dataHeight;
        }

        public ByteBuffer getImageBufferData() {
          return imageBuffer;
        }

        public int getTexHeight() {
          return dataHeight;
        }

        public int getTexWidth() {
          return dataWidth;
        }

        public int getWidth() {
          return dataWidth;
        }
      };
      images[0][0] = new Image(tempData, filter);
      xcount = 1;
      ycount = 1;
      inited = true;
      return;
    }
   
    xcount = ((realWidth-1) / tileSize) + 1;
    ycount = ((realHeight-1) / tileSize) + 1;
   
    images = new Image[xcount][ycount];
    int components = data.getDepth() / 8;
   
    for (int x=0;x<xcount;x++) {
      for (int y=0;y<ycount;y++) {
        int finalX = ((x+1) * tileSize);
        int finalY = ((y+1) * tileSize);
        final int imageWidth = Math.min((realWidth - (x*tileSize)), tileSize);
        final int imageHeight = Math.min((realHeight - (y*tileSize)), tileSize);
       
        final int xSize = tileSize;
        final int ySize = tileSize;
       
        final ByteBuffer subBuffer = BufferUtils.createByteBuffer(tileSize*tileSize*components);
        int xo = x*tileSize*components;

        byte[] byteData = new byte[xSize*components];
        for (int i=0;i<ySize;i++) {
          int yo = (((y * tileSize) + i) * dataWidth) * components;
          imageBuffer.position(yo+xo);
         
          imageBuffer.get(byteData, 0, xSize*components);
          subBuffer.put(byteData);
        }
       
        subBuffer.flip();
        ImageData imgData = new ImageData() {
          public int getDepth() {
            return data.getDepth();
          }

          public int getHeight() {
View Full Code Here

TOP

Related Classes of org.newdawn.slick.opengl.ImageData

Copyright © 2018 www.massapicom. 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.