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

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


            img.setDpi(dpiX, dpiY);
            img.setXYRatio(XYRatio);
            if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {
                try {
                    TIFFField fd = dir.getField(TIFFConstants.TIFFTAG_ICCPROFILE);
                    ICC_Profile icc_prof = ICC_Profile.getInstance(fd.getAsBytes());
                    if (icc_prof.getNumComponents() == 1)
                        img.tagICC(icc_prof);
                }
                catch (RuntimeException e) {
                    //empty
                }
View Full Code Here


            img.setDpi(dpiX, dpiY);
            if (compression != TIFFConstants.COMPRESSION_OJPEG && compression != TIFFConstants.COMPRESSION_JPEG) {
                if (dir.isTagPresent(TIFFConstants.TIFFTAG_ICCPROFILE)) {
                    try {
                        TIFFField fd = dir.getField(TIFFConstants.TIFFTAG_ICCPROFILE);
                        ICC_Profile icc_prof = ICC_Profile.getInstance(fd.getAsBytes());
                        if (samplePerPixel == icc_prof.getNumComponents())
                            img.tagICC(icc_prof);
                    }
                    catch (RuntimeException e) {
                        //empty
                    }
View Full Code Here

*/
public class ColorTools {

    public BufferedImage correctImage(BufferedImage src, File file)
            throws ImageReadException, IOException {
        ICC_Profile icc = Sanselan.getICCProfile(file);
        if (icc == null)
            return src;

        ICC_ColorSpace cs = new ICC_ColorSpace(icc);

View Full Code Here

                    + cs.getClass().getName());
            return;
        }

        ICC_ColorSpace fICC_ColorSpace = (ICC_ColorSpace) cs;
        ICC_Profile fICC_Profile = fICC_ColorSpace.getProfile();

        byte bytes[] = fICC_Profile.getData();

        IccProfileParser parser = new IccProfileParser();

        IccProfileInfo info = parser.getICCProfileInfo(bytes);
        info.dump(prefix);
View Full Code Here

        if (info == null)
            return null;
        if (info.issRGB())
            return null;

        ICC_Profile icc = ICC_Profile.getInstance(bytes);
        return icc;
    }
View Full Code Here

            PNGChunk pngChunktRNS = (PNGChunk) tRNSs.get(0);
            transparencyFilter = getTransparencyFilter(pngChunkIHDR.colorType,
                    pngChunktRNS);
        }

        ICC_Profile icc_profile = null;
        GammaCorrection gammaCorrection = null;
        {
            ArrayList sRGBs = filterChunks(chunks, sRGB);
            ArrayList gAMAs = filterChunks(chunks, gAMA);
            ArrayList iCCPs = filterChunks(chunks, iCCP);
View Full Code Here

            total = 0;
            for (int k = 0; k < icc.length; ++k) {
                System.arraycopy(icc[k], 14, ficc, total, icc[k].length - 14);
                total += icc[k].length - 14;
            }
            ICC_Profile icc_prof = ICC_Profile.getInstance(ficc);
            tagICC(icc_prof);
            icc = null;
        }
    }
View Full Code Here

    public final WritableRaster filter(Raster src, WritableRaster dst) {
        if (conversionSequence.length < 2) {
            throw new IllegalArgumentException(Messages.getString("awt.25D")); //$NON-NLS-1$
        }

        ICC_Profile srcPf = null, dstPf = null; // unused if isICC is false
        int nSrcColorComps, nDstColorComps;
        Object first = conversionSequence[0];
        Object last = conversionSequence[conversionSequence.length - 1];
       
        // Get the number of input/output color components
        if (isICC) {
            srcPf = (ICC_Profile) first;
            dstPf = (ICC_Profile) last;
            nSrcColorComps = srcPf.getNumComponents();
            nDstColorComps = dstPf.getNumComponents();
        } else {
            if (first instanceof ICC_Profile) {
                srcPf = (ICC_Profile) first;
                nSrcColorComps = srcPf.getNumComponents();
            } else {
                nSrcColorComps = ((ColorSpace) first).getNumComponents();
            }
           
            if (last instanceof ICC_Profile) {
View Full Code Here

            res = createCompatibleDestImage(src, null);
        }
        ColorModel dstCM = res.getColorModel();
        ColorSpace dstCS = dstCM.getColorSpace();
       
        ICC_Profile srcPf = null, dstPf = null;
        if (srcCS instanceof ICC_ColorSpace) {
            srcPf = ((ICC_ColorSpace)srcCS).getProfile();
        }
        if (dstCS instanceof ICC_ColorSpace) {
            dstPf = ((ICC_ColorSpace)dstCS).getProfile();
View Full Code Here

                if (dst != null) {
                    dstFlg = 1; // need dst profile
                }
            }
           
            ICC_Profile profiles[];
            int nProfiles = length + srcFlg + dstFlg;
            if (nProfiles == length) {
                profiles = convSeq;
            } else {
                profiles = new ICC_Profile[nProfiles];
View Full Code Here

TOP

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

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.