Package java.awt.image

Examples of java.awt.image.RenderedImage


              if (monitor.isCanceled()) {
                Platform.getJobManager().cancel(ExporterBase.EXPORT_JOB_FAMILY);
                return Status.CANCEL_STATUS;
              }
                try {
                    RenderedImage resourceChartImage = getResourceChart().getRenderedImage(
                            new GanttExportSettings(true, true, true, true));
                    File outputFile = File.createTempFile("resourcechart",
                            ".jpg");
                    state.resourceChartImageFile = outputFile;
                    ImageIO.write(resourceChartImage, JPG_FORMAT_NAME,
View Full Code Here


                if (monitor.isCanceled()) {
                    Platform.getJobManager().cancel(ExporterBase.EXPORT_JOB_FAMILY);
                    return Status.CANCEL_STATUS;
                }
                try {
                    RenderedImage ganttChartImage = getGanttChart().getRenderedImage(new GanttExportSettings(true, true, true, true));
                    File ganttChartImageFile;
                    ganttChartImageFile = replaceExtension(outputFile, GANTT_CHART_FILE_EXTENSION);
                    ImageIO.write(ganttChartImage, PNG_FORMAT_NAME, ganttChartImageFile);
                    resultFiles.add(ganttChartImageFile);
                    monitor.worked(1);
View Full Code Here

    public void run(File outputFile,ExportFinalizationJob finalizationJob) throws Exception {
        Chart chart = myUIFacade.getActiveChart();
        if (chart==null) {
            chart = myUIFacade.getGanttChart();
        }
        RenderedImage renderedImage = chart.getRenderedImage(new GanttExportSettings());
        ImageIO.write(renderedImage, myFileTypeOption.proposeFileExtension(),
                outputFile);
        finalizationJob.run(new File[] { outputFile });
    }
View Full Code Here

      }
     
      for (Map.Entry<Texture, File> textureEntry : this.textures.entrySet()) {
        Texture texture = textureEntry.getKey();
        ImageComponent2D imageComponent = (ImageComponent2D)texture.getImage(0);
        RenderedImage image = imageComponent.getRenderedImage();
        ImageIO.write(image, "png", textureEntry.getValue());       
      }
    } finally {
      if (writer != null) {
        writer.close();
View Full Code Here

        new File(tmpdir).mkdirs();
      } catch (Throwable e) {
        e.printStackTrace();
      }

      RenderedImage img = chart.createBufferedImage(Math.max(400,(openedRows.length==12?60:25)*openedRows.length),200);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ImageIO.write(img, "png", baos);
      baos.close();
      return baos.toByteArray();
    }
View Full Code Here

        new File(tmpdir).mkdirs();
      } catch (Throwable e) {
        e.printStackTrace();
      }
     
      RenderedImage img = chart.createBufferedImage(Math.max(400,(rows.length==12?60:25)*rows.length),200);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ImageIO.write(img, "png", baos);
      baos.close();
      return baos.toByteArray();
    }
View Full Code Here

   * @param degrees
   * @return rotated image
   */
  public static BufferedImage rotateImage(Image inputImage, int degrees) {
    BufferedImage retVal = null;
    RenderedImage ri = JAI.create("awtImage", inputImage);
    ParameterBlock pb = new ParameterBlock();
    pb.addSource(ri);
    TransposeType rotOp = null;
    RenderedOp op = null;
    if (degrees == 90) {
      rotOp = TransposeDescriptor.ROTATE_90;
    } else if (degrees == 180) {
      rotOp = TransposeDescriptor.ROTATE_180;
    } else if (degrees == 270) {
      rotOp = TransposeDescriptor.ROTATE_270;
    }
    if (rotOp != null) {
      // use Transpose operation
      pb.add(rotOp);
      op = JAI.create("transpose", pb);
    } else {
      // setup "normal" rotation
      pb.add(ri.getWidth() / 2.0f);
      pb.add(ri.getHeight() / 2.0f);
      pb.add((float) Math.toRadians(degrees));
      pb.add(new InterpolationNearest());
      op = JAI.create("Rotate", pb, null);
    }
    PlanarImage myPlanar = op.createInstance();
View Full Code Here

        if (!MediaLibAccessor.isMediaLibCompatible(args, layout) ||
            !MediaLibAccessor.hasSameNumBands(args, layout)) {
            return null;
        }

        RenderedImage source = args.getRenderedSource(0);

        SampleModel sm = source.getSampleModel();
        boolean isBilevel = (sm instanceof MultiPixelPackedSampleModel) &&
            (sm.getSampleSize(0) == 1) &&
            (sm.getDataType() == DataBuffer.TYPE_BYTE ||
             sm.getDataType() == DataBuffer.TYPE_USHORT ||
             sm.getDataType() == DataBuffer.TYPE_INT);
View Full Code Here

            message.append(getName() + " " +
                           JaiI18N.getString("BandSelectDescriptor2"));
            return false;
        }

  RenderedImage src = args.getRenderedSource(0);

        int bands = src.getSampleModel().getNumBands();
        for (int i = 0; i < indices.length; i++) {
            if (indices[i] < 0 || indices[i] >= bands) {
                message.append(getName() + " " +
                               JaiI18N.getString("BandSelectDescriptor3"));
                return false;
View Full Code Here

                          RenderableOp source,
                          RenderContextProxy renderContextProxy)
        throws RemoteException {
            RenderContext renderContext =
                renderContextProxy.getRenderContext();
            RenderedImage r = source.createRendering(renderContext);
            PlanarImage pi = PlanarImage.wrapRenderedImage(r);
            addSource(id, pi, pi);
    }
View Full Code Here

TOP

Related Classes of java.awt.image.RenderedImage

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.