Package java.awt.image

Examples of java.awt.image.ColorConvertOp


    // dumpColorSpace("\tcs_sRGB", cs_sRGB);
    // dumpColorSpace("\tColorModel.getRGBdefaultc",
    // ColorModel.getRGBdefault().getColorSpace());

    bi = relabelColorSpace(bi, from);
    ColorConvertOp op = new ColorConvertOp(from, to, hints);
    bi = op.filter(bi, null);

    bi = relabelColorSpace(bi, from);

    bi = op.filter(bi, null);

    bi = relabelColorSpace(bi, to);

    return bi;
View Full Code Here


    hints.put(RenderingHints.KEY_COLOR_RENDERING,
        RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    hints.put(RenderingHints.KEY_DITHERING,
        RenderingHints.VALUE_DITHER_ENABLE);

    ColorConvertOp op = new ColorConvertOp(from, to, hints);

    bi = relabelColorSpace(bi, from);

    BufferedImage result = op.filter(bi, null);

    result = relabelColorSpace(result, to);

    return result;
  }
View Full Code Here

        BufferedImage buf = new BufferedImage(img.getWidth(), img.getHeight(),
                BufferedImage.TYPE_BYTE_BINARY);
        RenderingHints hints = new RenderingHints(null);
        //This hint doesn't seem to make a difference :-(
        hints.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
        ColorConvertOp op = new ColorConvertOp(
                ColorSpace.getInstance(ColorSpace.CS_GRAY), hints);
        op.filter(img, buf);
        return buf;
    }
View Full Code Here

            BufferedImage src = null;
            if (img instanceof BufferedImage && !scaled) {
                if (!isGrayscaleImage(img) || img.getColorModel().hasAlpha()) {
                    src = new BufferedImage(effDim.width, effDim.height,
                            BufferedImage.TYPE_BYTE_GRAY);
                    ColorConvertOp op = new ColorConvertOp(
                            ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
                    op.filter((BufferedImage)img, src);
                } else {
                    src = (BufferedImage)img;
                }
            }
            if (src == null) {
View Full Code Here

      BufferedImage image = ImageIO.read(data);
      // If it is not a gray scale image
      if (image.getType() != BufferedImage.TYPE_BYTE_GRAY) {
        // Convert the image to grayscale;
        ColorConvertOp conv = new ColorConvertOp(
            ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
        conv.filter(image, image);
      }

      // Rescale the image
      image = RescaleImage(image, width.intValue(), height.intValue());
View Full Code Here

                                  null);

        // System.out.println("src: " + srcBI.getWidth() + "x" +
        //                    srcBI.getHeight());

        ColorConvertOp op = new ColorConvertOp(dstCM.getColorSpace(),
                                               null);
        dstBI = op.filter(srcBI, null);

        // System.out.println("After filter:");

        WritableRaster wr00 = wr.createWritableTranslatedChild(0,0);
        for (int i=0; i<dstCM.getColorSpace().getNumComponents(); i++)
View Full Code Here

    public WritableRaster apply( WritableRaster image ) {
        if( ! enabled ) {
            return image;
        }
        ColorSpace grayspace = ColorSpace.getInstance( ColorSpace.CS_GRAY );
        ColorConvertOp op = new ColorConvertOp( grayspace, null );
        WritableRaster r = op.filter( image, null );
        return r;
    }   
View Full Code Here

             *                    srcBI.getHeight());
             * System.out.println("dst: " + dstBI.getWidth() + "x" +
             *                    dstBI.getHeight());
             */

            ColorConvertOp op = new ColorConvertOp(null);
            op.filter(srcBI, dstBI);

            if (dstCM.hasAlpha())
                copyBand(srcWr, srcSM.getNumBands()-1,
                         wr,    getSampleModel().getNumBands()-1);
        }
View Full Code Here

    if (isGreyscale(cs) && bpc <= 8 && getDecode() == null
        && jpegData == null) {
      bi = convertGreyscaleToArgb(data, bi);
    } else if (!isImageMask() && cs instanceof ICC_ColorSpace
        && !cs.equals(rgbCS)) {
      ColorConvertOp op = new ColorConvertOp(cs, rgbCS, null);

      BufferedImage converted = new BufferedImage(getWidth(),
          getHeight(), BufferedImage.TYPE_INT_ARGB);

      bi = op.filter(bi, converted);
    }

    // add in the alpha data supplied by the SMask, if any
    PDFImage sMaskImage = getSMask();
    if (sMaskImage != null) {
View Full Code Here

        new DataBufferInt(argbVals, argbVals.length), argbVals.length,
        1, argbVals.length, ((PackedColorModel) ccm).getMasks(), null);
    final BufferedImage srgbImage = new BufferedImage(ccm, outRaster,
        false, null);

    final ColorConvertOp op = new ColorConvertOp(greyCs,
        ColorSpace.getInstance(ColorSpace.CS_sRGB), null);

    op.filter(greyImage, srgbImage);

    GREY_TO_ARGB[numBits - 1] = argbVals;
    return argbVals;
  }
View Full Code Here

TOP

Related Classes of java.awt.image.ColorConvertOp

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.