Examples of ImageData


Examples of org.eclipse.swt.graphics.ImageData

    /* (non-Javadoc)
     * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
     */
    protected void drawCompositeImage(int width, int height) {
        ImageData bg;
        if (fBase == null || (bg = fBase.getImageData()) == null) {
      bg = DEFAULT_IMAGE_DATA;
    }
        drawImage(bg, 0, 0);

View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

    protected void drawTopRight(ImageDescriptor overlay) {
        if (overlay == null) {
      return;
    }
        int x = getSize().x;
        ImageData id = overlay.getImageData();
        x -= id.width;
        drawImage(id, x, 0);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

                alphaBytes[i] = (byte) alpha;
            }
            nnStopWatch.print();
            // define a direct palette with masks for RGB
            PaletteData palette = new PaletteData(0xFF0000 , 0xFF00 , 0xFF);  
            ImageData imageData = new ImageData(mapSize, mapSize, 24, palette, mapSize*3, imageBytes);
            // enable alpha by setting alphabytes ... strange that i can't do that per pixel using 32bit values
            imageData.alphaData = alphaBytes;
            return new Image(device, imageData);           
        }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

      new RGB [] {
        new RGB (0, 0, 0),
        new RGB (red, green, blue),
        new RGB (0xFF, 0xFF, 0xFF),
      });
    ImageData maskData = new ImageData (1, height, 2, palette);
    for (int y=0; y < height; y++)
      maskData.setPixel(0, y, 1);
    Image image = new Image (display, maskData);
    caret.setImage(image);
    control.setCaret(caret);
  }
View Full Code Here

Examples of org.eclipse.swt.graphics.ImageData

    static final int DEFAULT_HEIGHT = 16;
    static final int DEFAULT_DEPTH = 24;

    private static Image image( Display display, RGB[] rgb ) {
        PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF);
        ImageData imageData = new ImageData(DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_DEPTH, palette);
        imageData.transparentPixel = palette.getPixel(display.getSystemColor(
                SWT.COLOR_WIDGET_BACKGROUND).getRGB());

        return new Image(display, imageData);
    }
View Full Code Here

Examples of org.mifosplatform.infrastructure.documentmanagement.data.ImageData

        if (output != null && (output.equals("octet") || output.equals("inline_octet"))) { return downloadClientImage(clientId, maxWidth,
                maxHeight, output); }

        this.context.authenticatedUser().validateHasReadPermission("CLIENTIMAGE");

        final ImageData imageData = this.imageReadPlatformService.retrieveClientImage(clientId);

        // TODO: Need a better way of determining image type
        String imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.JPEG.getValue();
        if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.IMAGE_FILE_EXTENSION.GIF.getValue())) {
            imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.GIF.getValue();
        } else if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.IMAGE_FILE_EXTENSION.PNG.getValue())) {
            imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.PNG.getValue();
        }

        final String clientImageAsBase64Text = imageDataURISuffix + Base64.encodeBytes(imageData.getContentOfSize(maxWidth, maxHeight));
        return Response.ok(clientImageAsBase64Text).build();
    }
View Full Code Here

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

Examples of org.sbml.jsbml.ext.spatial.ImageData

        return sf;
      }
    } else if (contextObject instanceof SampledField) {
      SampledField sf = (SampledField) contextObject;
      if (elementName.equals(SpatialConstants.imageData)){
        ImageData im = new ImageData();
        sf.setImageData(im);
        return im;
      }
    } else if (contextObject instanceof CSGeometry) {
      CSGeometry csg = (CSGeometry) contextObject;
View Full Code Here

Examples of ru.snake.spritepacker.core.packer.ImageData

        }

        ImagePacker packer = new ImagePacker(margin, padding);

        for (Texture eachTexture : allTextures) {
          ImageData data = new ImageData(animationIndex, eachTexture);

          packer.addItem(data);
        }

        output.setNameFormat(eachAnimation.name + "-", null);

        packer.setOutput(output);
        packer.process(maxWidth, maxHeight, true);

        animationIndex++;
      }
    } else {
      Set<Texture> allTextures = new HashSet<Texture>();

      for (Animation eachAnimation : animations.getList()) {
        for (Sprite eachSprite : eachAnimation.getSprites()) {
          allTextures.add(eachSprite.texture);
        }
      }

      ImagePacker packer = new ImagePacker(margin, padding);

      for (Texture eachTexture : allTextures) {
        ImageData data = new ImageData(eachTexture);

        packer.addItem(data);
      }

      output.setNameFormat("atlas-", null);
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.