Examples of createCompatibleWritableRaster()


Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

     *   of <code>image</code>
     */
    public static BufferedImage createColorModelCompatibleImage(BufferedImage image) {
        ColorModel cm = image.getColorModel();
        return new BufferedImage(cm,
            cm.createCompatibleWritableRaster(image.getWidth(),
                                              image.getHeight()),
            cm.isAlphaPremultiplied(), null);
    }

    /**
 
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

     */
    public static BufferedImage makeLinearBufferedImage(int width,
                                                        int height,
                                                        boolean premult) {
        ColorModel cm = makeLinear_sRGBCM(premult);
        WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
        return new BufferedImage(cm, wr, premult, null);
    }

    /**
     * This method will return a CacheableRed that has it's data in
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

     */
    public static BufferedImage makeLinearBufferedImage(int width,
                                                        int height,
                                                        boolean premult) {
        ColorModel cm = makeLinear_sRGBCM(premult);
        WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
        return new BufferedImage(cm, wr, premult, null);
    }

    /**
     * This method will return a CacheableRed that has it's data in
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            final PixelGrabber grabber = new PixelGrabber(image, 0, 0, image.getWidth(null),
                image.getHeight(null), true);
            if (grabber.grabPixels(10000)) {
                final int w = grabber.getWidth();
                final int h = grabber.getHeight();
                final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h);
                final int[] pixels = (int[]) grabber.getPixels();
                Object dataElems = null;
                for (int y = 0; y < h; y++) {
                    final int ofsY = y * w;
                    for (int x = 0; x < w; x++) {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

        //todo optimize
        final ColorModel dst_model = surface.getColorModel();
        final int[] samples = new int[4];
        final int w = raster.getWidth();
        final int h = raster.getHeight();
        final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h);

        if (dst_model instanceof DirectColorModel) {
            if ((model instanceof DirectColorModel) || (model instanceof ComponentColorModel)) {
                for (int y = 0; y < h; y++) {
                    for (int x = 0; x < w; x++) {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            // Convert it to a raster
            final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true);
            if (grabber.grabPixels()) {
                final int w = grabber.getWidth();
                final int h = grabber.getHeight();
                final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h);
                final int[] pixels = (int[]) grabber.getPixels();
                Object dataElems = null;
                for (int y = 0; y < h; y++) {
                    final int ofsY = y * w;
                    for (int x = 0; x < w; x++) {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

            final PixelGrabber grabber =
                new PixelGrabber(image, 0, 0, image.getWidth(null), image.getHeight(null), true);
            if (grabber.grabPixels()) {
                final int w = grabber.getWidth();
                final int h = grabber.getHeight();
                final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h);
                final int[] pixels = (int[]) grabber.getPixels();
                Object dataElems = null;
                for (int y = 0; y < h; y++) {
                    final int ofsY = y * w;
                    for (int x = 0; x < w; x++) {
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

        //todo optimize
        final ColorModel dst_model = surface.getColorModel();
        final int[] samples = new int[4];
        final int w = raster.getWidth();
        final int h = raster.getHeight();
        final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h);

        if (dst_model instanceof DirectColorModel)
            if (model instanceof DirectColorModel) {
                for (int y = 0; y < h; y++)
                    for (int x = 0; x < w; x++)
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

        //todo optimize
        final ColorModel dst_model = surface.getColorModel();
        final int[] samples = new int[4];
        final int w = raster.getWidth();
        final int h = raster.getHeight();
        final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h);

        if (dst_model instanceof DirectColorModel)
            if (model instanceof ComponentColorModel) {
                for (int y = 0; y < h; y++)
                    for (int x = 0; x < w; x++)
View Full Code Here

Examples of java.awt.image.ColorModel.createCompatibleWritableRaster()

   *         of <code>image</code>
   */
  public static BufferedImage createColorModelCompatibleImage(final BufferedImage image) {
    final ColorModel cm = image.getColorModel();
    //noinspection UndesirableClassUsage
    return new BufferedImage(cm, cm.createCompatibleWritableRaster(image.getWidth(), image.getHeight()), cm.isAlphaPremultiplied(), null);
  }


  /**
   * <p>Returns a new compatible image with the same width, height and
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.