Package com.jgraph.gaeawt.java.awt.image

Examples of com.jgraph.gaeawt.java.awt.image.BufferedImage


{
  public static BufferedImage clipImageTest() throws IOException, ImageReadException
  {
    int w = 600;
    int h = 600;
    BufferedImage imageARGB = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    String filename = "Venus of Urbino.jpg";
    InputStream in = ClipImage.class.getResourceAsStream(filename);
    final BufferedImage image = Sanselan.getBufferedImage(in);
    in.close();

    Graphics2D g2 = imageARGB.createGraphics();
    g2.rotate(-Math.PI / 12, image.getWidth() / 2, image.getHeight() / 2);
    String s = "bella";
    Font font = new Font("Serif", Font.PLAIN, 192);
    FontRenderContext frc = g2.getFontRenderContext();
    //GlyphVector gv = font.createGlyphVector(frc, s);
    //Shape clippingShape = gv.getOutline(10, 200);
View Full Code Here


      int bitsPerPixel = bitsPerSample * samplesPerPixel;

      boolean hasAlpha = colorType == COLOR_TYPE_GREYSCALE_WITH_ALPHA
          || colorType == COLOR_TYPE_TRUE_COLOR_WITH_ALPHA;

      BufferedImage result;
      if (isGrayscale)
        result = getBufferedImageFactory(params)
            .getGrayscaleBufferedImage(width, height, hasAlpha);
      else
        result = getBufferedImageFactory(params).getColorBufferedImage(
View Full Code Here

              "Short image data but not a 32 bit compressed type");
      }
      else
        imageData = imageElement.data;

      BufferedImage bufferedImage = new BufferedImage(imageType.getWidth(),
          imageType.getHeight(), BufferedImage.TYPE_INT_ARGB);
      switch (imageType.getBitsPerPixel())
      {
        case 1:
          decode1BPPImage(imageType, imageData, bufferedImage);
View Full Code Here

        // int transfer_type;

        // transfer_type = DataBuffer.TYPE_BYTE;

        boolean hasAlpha = false;
        BufferedImage result = getBufferedImageFactory(params)
                .getColorBufferedImage(width, height, hasAlpha);

        DataParser dataParser;
        switch (imageContents.header.Mode)
        {
View Full Code Here

        boolean hasAlpha = false;
        if (gce != null && gce.transparency)
            hasAlpha = true;

        BufferedImage result = getBufferedImageFactory(params)
                .getColorBufferedImage(width, height, hasAlpha);

        {
            int colorTable[];
            if (id.localColorTable != null)
                colorTable = getColorTable(id.localColorTable);
            else if (imageContents.globalColorTable != null)
                colorTable = getColorTable(imageContents.globalColorTable);
            else
                throw new ImageReadException("Gif: No Color Table");

            int transparentIndex = -1;
            if (hasAlpha)
                transparentIndex = gce.transparentColorIndex;

            int counter = 0;

            int rowsInPass1 = (height + 7) / 8;
            int rowsInPass2 = (height + 3) / 8;
            int rowsInPass3 = (height + 1) / 4;
            int rowsInPass4 = (height) / 2;

            int[] db = result.getRaster().getDataBuffer();

            for (int row = 0; row < height; row++)
            {
                int y;
                if (id.interlaceFlag)
View Full Code Here

    IcnsContents contents = readImage(byteSource);
    ArrayList images = IcnsDecoder.decodeAllImages(contents.icnsElements);
    if (images.isEmpty())
      throw new ImageReadException("No icons in ICNS file");
    BufferedImage image0 = (BufferedImage) images.get(0);
    return new ImageInfo("Icns", 32, new ArrayList(), ImageFormat.IMAGE_FORMAT_ICNS,
        "ICNS Apple Icon Image", image0.getHeight(), "image/x-icns", images.size(),
        0, 0, 0, 0, image0.getWidth(), false, true, false, ImageInfo.COLOR_TYPE_RGB,
        ImageInfo.COMPRESSION_ALGORITHM_UNKNOWN);
  }
View Full Code Here

    IcnsContents contents = readImage(byteSource);
    ArrayList images = IcnsDecoder.decodeAllImages(contents.icnsElements);
    if (images.isEmpty())
      throw new ImageReadException("No icons in ICNS file");
    BufferedImage image0 = (BufferedImage) images.get(0);
    return new Dimension(image0.getWidth(), image0.getHeight());
  }
View Full Code Here

    {
        FormatCompliance formatCompliance = FormatCompliance.getDefault();
        TiffContents contents = new TiffReader(isStrict(params))
                .readFirstDirectory(byteSource, params, true, formatCompliance);
        TiffDirectory directory = (TiffDirectory) contents.directories.get(0);
        BufferedImage result = directory.getTiffImage(params);
        if (null == result)
            throw new ImageReadException("TIFF does not contain an image.");
        return result;
    }
View Full Code Here

            throw new ImageReadException("Tiff: samplesPerPixel ("
                    + samplesPerPixel + ")!=fBitsPerSample.length ("
                    + bitsPerSample.length + ")");

        boolean hasAlpha = false;
        BufferedImage result = getBufferedImageFactory(params)
                .getColorBufferedImage(width, height, hasAlpha);

        PhotometricInterpreter photometricInterpreter = getPhotometricInterpreter(
                directory, photometricInterpretation, bitsPerPixel,
                bitsPerSample, predictor, samplesPerPixel, width, height);
View Full Code Here

        ArrayList dirs = exif.getDirectories();
        for (int i = 0; i < dirs.size(); i++) {
            TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) dirs
                    .get(i);
            // Debug.debug("dir", dir);
            BufferedImage image = dir.getThumbnail();
            if (null != image) {
                return image;
            }

            JpegImageData jpegImageData = dir.getJpegImageData();
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.awt.image.BufferedImage

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.