sun.awt.image.ImageRepresentation Java Examples

The following examples show how to use sun.awt.image.ImageRepresentation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DrawImage.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #2
Source File: DrawImage.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #3
Source File: ToolkitImage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void reconstruct(int flags) {
    if ((flags & ~availinfo) != 0) {
        if ((availinfo & ImageObserver.ERROR) != 0) {
            return;
        }
        ImageRepresentation ir = getImageRep();
        ir.startProduction();
        while ((flags & ~availinfo) != 0) {
            try {
                wait();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                return;
            }
            if ((availinfo & ImageObserver.ERROR) != 0) {
                return;
            }
        }
    }
}
 
Example #4
Source File: DrawImage.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
Example #5
Source File: ToolkitImage.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #6
Source File: DrawImage.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #7
Source File: ToolkitImage.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #8
Source File: DrawImage.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
Example #9
Source File: ToolkitImage.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #10
Source File: DrawImage.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
Example #11
Source File: DrawImage.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
Example #12
Source File: DrawImage.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #13
Source File: ToolkitImage.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void reconstruct(int flags) {
    if ((flags & ~availinfo) != 0) {
        if ((availinfo & ImageObserver.ERROR) != 0) {
            return;
        }
        ImageRepresentation ir = getImageRep();
        ir.startProduction();
        while ((flags & ~availinfo) != 0) {
            try {
                wait();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                return;
            }
            if ((availinfo & ImageObserver.ERROR) != 0) {
                return;
            }
        }
    }
}
 
Example #14
Source File: DrawImage.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
Example #15
Source File: ToolkitImage.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private synchronized void reconstruct(int flags) {
    if ((flags & ~availinfo) != 0) {
        if ((availinfo & ImageObserver.ERROR) != 0) {
            return;
        }
        ImageRepresentation ir = getImageRep();
        ir.startProduction();
        while ((flags & ~availinfo) != 0) {
            try {
                wait();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                return;
            }
            if ((availinfo & ImageObserver.ERROR) != 0) {
                return;
            }
        }
    }
}
 
Example #16
Source File: DrawImage.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #17
Source File: ToolkitImage.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #18
Source File: ToolkitImage.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void reconstruct(int flags) {
    if ((flags & ~availinfo) != 0) {
        if ((availinfo & ImageObserver.ERROR) != 0) {
            return;
        }
        ImageRepresentation ir = getImageRep();
        ir.startProduction();
        while ((flags & ~availinfo) != 0) {
            try {
                wait();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                return;
            }
            if ((availinfo & ImageObserver.ERROR) != 0) {
                return;
            }
        }
    }
}
 
Example #19
Source File: ToolkitImage.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #20
Source File: ToolkitImage.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void reconstruct(int flags) {
    if ((flags & ~availinfo) != 0) {
        if ((availinfo & ImageObserver.ERROR) != 0) {
            return;
        }
        ImageRepresentation ir = getImageRep();
        ir.startProduction();
        while ((flags & ~availinfo) != 0) {
            try {
                wait();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                return;
            }
            if ((availinfo & ImageObserver.ERROR) != 0) {
                return;
            }
        }
    }
}
 
Example #21
Source File: ToolkitImage.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void flush() {
    if (src != null) {
        src.checkSecurity(null, false);
    }

    ImageRepresentation ir;
    synchronized (this) {
        availinfo &= ~ImageObserver.ERROR;
        ir = imagerep;
        imagerep = null;
    }
    if (ir != null) {
        ir.abort();
    }
    if (src != null) {
        src.flush();
    }
}
 
Example #22
Source File: DrawImage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
Example #23
Source File: DrawImage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
Example #24
Source File: DrawImage.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
Example #25
Source File: IconInfo.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public IconInfo(Image image) {
    this.image = image;
    if (image instanceof ToolkitImage) {
        ImageRepresentation ir = ((ToolkitImage)image).getImageRep();
        ir.reconstruct(ImageObserver.ALLBITS);
        this.width = ir.getWidth();
        this.height = ir.getHeight();
    } else {
        this.width = image.getWidth(null);
        this.height = image.getHeight(null);
    }
    this.scaledWidth = width;
    this.scaledHeight = height;
    this.rawLength = width * height + 2;
}
 
Example #26
Source File: DrawImage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public boolean copyImage(SunGraphics2D sg, Image img,
                         int x, int y,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, x, y, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, bgColor, observer);
    }
}
 
Example #27
Source File: IconInfo.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public IconInfo(Image image) {
    this.image = image;
    if (image instanceof ToolkitImage) {
        ImageRepresentation ir = ((ToolkitImage)image).getImageRep();
        ir.reconstruct(ImageObserver.ALLBITS);
        this.width = ir.getWidth();
        this.height = ir.getHeight();
    } else {
        this.width = image.getWidth(null);
        this.height = image.getHeight(null);
    }
    this.scaledWidth = width;
    this.scaledHeight = height;
    this.rawLength = width * height + 2;
}
 
Example #28
Source File: DrawImage.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean copyImage(SunGraphics2D sg, Image img,
                         int x, int y,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, x, y, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, bgColor, observer);
    }
}
 
Example #29
Source File: DrawImage.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public boolean transformImage(SunGraphics2D sg, Image img,
                              AffineTransform atfm,
                              ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        transformImage(sg, img, 0, 0, atfm, sg.interpolationType);
        return true;
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, atfm, observer);
    }
}
 
Example #30
Source File: IconInfo.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public IconInfo(Image image) {
    this.image = image;
    if (image instanceof ToolkitImage) {
        ImageRepresentation ir = ((ToolkitImage)image).getImageRep();
        ir.reconstruct(ImageObserver.ALLBITS);
        this.width = ir.getWidth();
        this.height = ir.getHeight();
    } else {
        this.width = image.getWidth(null);
        this.height = image.getHeight(null);
    }
    this.scaledWidth = width;
    this.scaledHeight = height;
    this.rawLength = width * height + 2;
}