Examples of ICC_ColorSpace


Examples of java.awt.color.ICC_ColorSpace

    private final ICC_ColorSpace colorSpace;

    public ICCProfileWrapper(final ICC_Profile _profile)
    {
        this.profile = _profile;
        this.colorSpace = new ICC_ColorSpace(_profile);
    }
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

        InputStream profile = null;
        try
        {
            profile = stream.createInputStream();
            iccProfile = ICC_Profile.getInstance(profile);
            awtColorSpace = new ICC_ColorSpace(iccProfile);

            // set initial colour
            float[] initial = new float[getNumberOfComponents()];
            for (int c = 0; c < getNumberOfComponents(); c++)
            {
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

        ICC_Profile iccProfile = getICCProfile();
        if (iccProfile == null)
        {
            throw new IOException("Default CMYK color profile could not be loaded");
        }
        awtColorSpace = new ICC_ColorSpace(iccProfile);

        // there is a JVM bug which results in a CMMException which appears to be a race
        // condition caused by lazy initialization of the color transform, so we perform
        // an initial color conversion while we're still in a static context, see PDFBOX-2184
        awtColorSpace.toRGB(new float[] { 0, 0, 0, 0 });
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

    private final ICC_ColorSpace colorSpace;

    public ICCProfileWrapper(final ICC_Profile _profile)
    {
        this.profile = _profile;
        this.colorSpace = new ICC_ColorSpace(_profile);
    }
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

            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);
           
            scaler.loadScalingData(dst, null);
            scaler.unscaleNormalized(dst, tmpData);
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

        // Get destination color space
        Object destination = conversionSequence[nSpaces-1];
        ColorSpace dstCS =
            (destination instanceof ColorSpace) ?
                    (ColorSpace) destination :
                    new ICC_ColorSpace((ICC_Profile) destination);
       
        ColorModel srcCM = src.getColorModel();    
        ColorModel dstCM = new ComponentColorModel(dstCS,
                srcCM.hasAlpha(),
                srcCM.isAlphaPremultiplied(),
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

        {
            retval = PDDeviceRGB.INSTANCE;
        }
        else if( cs instanceof ICC_ColorSpace )
        {
            ICC_ColorSpace ics = (ICC_ColorSpace)cs;
            PDICCBased pdCS = new PDICCBased( doc );
            retval = pdCS;
            COSArray ranges = new COSArray();
            for( int i=0; i<cs.getNumComponents(); i++ )
            {
                ranges.add( new COSFloat( ics.getMinValue( i ) ) );
                ranges.add( new COSFloat( ics.getMaxValue( i ) ) );
            }
            PDStream iccData = pdCS.getPDStream();
            OutputStream output = null;
            try
            {
                output = iccData.createOutputStream();
                output.write( ics.getProfile().getData() );
            }
            finally
            {
                if( output != null )
                {
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

        ColorSpace cSpace = null;
        try
        {
            profile = stream.createInputStream();
            ICC_Profile iccProfile = ICC_Profile.getInstance( profile );
            cSpace = new ICC_ColorSpace( iccProfile );
            float[] components = new float[numberOfComponents];
            // there maybe a ProfileDataException or a CMMException as there
            // are some issues when loading ICC_Profiles, see PDFBOX-1295
            // Try to create a color as test ...
            new Color(cSpace,components,1f);
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

                    !isUncOrDevicePath(profile))
                {
                    String path = new String(profile, "windows-1252");

                    colorSpace =
                        new ICC_ColorSpace(ICC_Profile.getInstance(path));
                } else {
                    colorSpace =
                        new ICC_ColorSpace(ICC_Profile.getInstance(profile));
                }
            } catch (Exception e) {
                colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
            }
        }
View Full Code Here

Examples of java.awt.color.ICC_ColorSpace

         * embedded data.
         */
        if (oldData == null ||
            !java.util.Arrays.equals(oldData, newData))
        {
            iccCS = new ICC_ColorSpace(newProfile);
            // verify new color space
            try {
                float[] colors = iccCS.fromRGB(new float[] {1f, 0f, 0f});
            } catch (CMMException e) {
                /*
 
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.