Package com.google.code.appengine.awt.color

Examples of com.google.code.appengine.awt.color.ColorSpace


            // TODO: implement
            throw new UnsupportedOperationException(Messages.getString("imageio.80"));
        }

        boolean hasAlpha = cm.hasAlpha();
        ColorSpace cs = cm.getColorSpace();
        switch(cs.getType()) {
            case ColorSpace.TYPE_GRAY:
                type = JPEGConsts.JCS_GRAYSCALE;
                break;
           case ColorSpace.TYPE_RGB:
                type = hasAlpha ? JPEGConsts.JCS_RGBA : JPEGConsts.JCS_RGB;
View Full Code Here


    private int getDestinationCSType(RenderedImage image) {
        int type = JPEGConsts.JCS_UNKNOW;
        ColorModel cm = image.getColorModel();
        if (null != cm) {
            boolean hasAlpha = cm.hasAlpha();
            ColorSpace cs = cm.getColorSpace();

            switch(cs.getType()) {
                case ColorSpace.TYPE_GRAY:
                    type = JPEGConsts.JCS_GRAYSCALE;
                    break;
               case ColorSpace.TYPE_RGB:
                    type = hasAlpha ? JPEGConsts.JCS_YCbCrA : JPEGConsts.JCS_YCbCr;
View Full Code Here

        }
        return count;
    }

    public BufferedImage convertToColorSpace(BufferedImage bi, ColorSpace to) {
        ColorSpace from = bi.getColorModel().getColorSpace();

        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
                RenderingHints.VALUE_RENDER_QUALITY);
        hints.put(RenderingHints.KEY_COLOR_RENDERING,
                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
View Full Code Here

        return result;
    }

    public BufferedImage convertTosRGB(BufferedImage bi) {
        ColorSpace cs_sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);

        ColorModel srgbCM = ColorModel.getRGBdefault();
        cs_sRGB = srgbCM.getColorSpace();

        return convertToColorSpace(bi, cs_sRGB);
View Full Code Here

        return convertToColorSpace(bi, cs_sRGB);
    }

    protected BufferedImage convertFromColorSpace(BufferedImage bi,
            ColorSpace from) {
        ColorSpace cs_sRGB;

        ColorModel srgbCM = ColorModel.getRGBdefault();
        cs_sRGB = srgbCM.getColorSpace();

        return convertBetweenColorSpaces(bi, from, cs_sRGB);
View Full Code Here

        if ((bits != 1) && (bits != 2) && (bits != 4) && (bits != 8) && (bits != 16)) {
            throw new IllegalArgumentException();
        }

        ColorSpace colorSpace = ColorSpace.getInstance(ColorSpace.CS_GRAY);

        int numComponent = hasAlpha ? 2 : 1;
        int numBits[] = new int[numComponent];
        numBits[0] = bits;
        if (numComponent ==2) {
View Full Code Here

                if (is_srgb == null || !is_srgb.booleanValue())
                {
                    ICC_ColorSpace cs = new ICC_ColorSpace(icc_profile);

                    ColorModel srgbCM = ColorModel.getRGBdefault();
                    ColorSpace cs_sRGB = srgbCM.getColorSpace();

                    result = new ColorTools().convertBetweenColorSpaces(result,
                            cs, cs_sRGB);
                }
            }
View Full Code Here

        surfaceType = type;

        DataBuffer db = raster.getDataBuffer();
        data = ba.getData(db);
        ba.addDataBufferListener(db, this);
        ColorSpace cs = cm.getColorSpace();
        transparency = cm.getTransparency();
        width = raster.getWidth();
        height = raster.getHeight();
        addDirtyRegion(new Rectangle(0, 0, width, height));
View Full Code Here

     * @return - type of BufferedImage
     */
    public static int getType(ColorModel cm, WritableRaster raster){
        int transferType = cm.getTransferType();
        boolean hasAlpha = cm.hasAlpha();
        ColorSpace cs = cm.getColorSpace();
        int csType = cs.getType();
        SampleModel sm = raster.getSampleModel();

        if(csType == ColorSpace.TYPE_RGB){
            if(cm instanceof DirectColorModel){
                DirectColorModel dcm = (DirectColorModel) cm;
View Full Code Here

            ColorScaler scaler = new ColorScaler();
            scaler.loadScalingData(src, null);
            float tmpData[][] = scaler.scaleNormalize(src);
           
            // Get source and destination color spaces
            ColorSpace srcCS = (srcPf == null) ?
                    (ColorSpace) first:
                    new ICC_ColorSpace(srcPf);
            ColorSpace dstCS = (dstPf == null) ?
                    (ColorSpace) last:
                    new ICC_ColorSpace(dstPf);
                   
            applySequence(sequence, tmpData, srcCS, dstCS);
           
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.color.ColorSpace

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.