Package java.awt.image

Examples of java.awt.image.WritableRenderedImage


   * @param szFile the path of the file to save the image in. The
   * file suffix is used to determine the image type (JPEG or PNG).
   * Storage is in JPEG by default.
   */
  public void toFile(RgbImage rgb, String szFile) {
    WritableRenderedImage im = RgbImageJ2se.toImage(rgb);
    String szSuffix = "JPG";
    if (szFile.contains(".")) {
      int nSuffix = szFile.lastIndexOf('.');
      szSuffix = szFile.substring(nSuffix + 1);
    }
View Full Code Here


     
    }
  }
 
  private static WritableRenderedImage toImage(RgbImage rgb) {
    WritableRenderedImage im = new BufferedImage(
        rgb.getWidth(),
        rgb.getHeight(),
        BufferedImage.TYPE_INT_RGB);
    DataBufferInt dbi = new DataBufferInt(
        rgb.getData(),
        rgb.getHeight() * rgb.getWidth());
    Raster r = Raster.createRaster(
        im.getSampleModel(),
        dbi,
        null);
    im.setData(r);
    return im;
  }
View Full Code Here

        this.source = source;
        //  Set image parameters to match the source

        //  Determine which tiles of the source image are writable
        if (source instanceof WritableRenderedImage) {
            WritableRenderedImage wri = (WritableRenderedImage)source;
            wri.addTileObserver(this);

            Point[] pts = wri.getWritableTileIndices();
            if (pts != null) {
                int num = pts.length;
                for (int i = 0; i < num; i++) {
                    //  Add these tiles to the active list
                    Point p = pts[i];
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRectIter allowing read/write access to the source.
     */
    public static WritableRectIter createWritable(WritableRaster ras,
                                                  Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRandomIter allowing read/write access to the source.
     */
    public static WritableRandomIter createWritable(WritableRaster ras,
                                                    Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRookIter allowing read/write access to the source.
     */
    public static WritableRookIter createWritable(WritableRaster ras,
                                                  Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

        this.source = source;
        //  Set image parameters to match the source

        //  Determine which tiles of the source image are writable
        if (source instanceof WritableRenderedImage) {
            WritableRenderedImage wri = (WritableRenderedImage)source;
            wri.addTileObserver(this);

            Point[] pts = wri.getWritableTileIndices();
            if (pts != null) {
                int num = pts.length;
                for (int i = 0; i < num; i++) {
                    //  Add these tiles to the active list
                    Point p = pts[i];
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRandomIter allowing read/write access to the source.
     */
    public static WritableRandomIter createWritable(WritableRaster ras,
                                                    Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRookIter allowing read/write access to the source.
     */
    public static WritableRookIter createWritable(WritableRaster ras,
                                                  Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

     * @param bounds the bounding Rectangle for the iterator, or null.
     * @return a WritableRectIter allowing read/write access to the source.
     */
    public static WritableRectIter createWritable(WritableRaster ras,
                                                  Rectangle bounds) {
        WritableRenderedImage im = new WrapperWRI(ras);
        return createWritable(im, bounds);
    }
View Full Code Here

TOP

Related Classes of java.awt.image.WritableRenderedImage

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.