Package java.awt.color

Examples of java.awt.color.ICC_ColorSpace


            if (icc_profile != null)
            {
                Boolean is_srgb = new IccProfileParser().issRGB(icc_profile);
                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,
View Full Code Here


        ColorSpace cSpace = null;
        try
        {
            profile = stream.createInputStream();
            ICC_Profile iccProfile = ICC_Profile.getInstance( profile );
            cSpace = new ICC_ColorSpace( iccProfile );
        }
        finally
        {
            if( profile != null )
            {
View Full Code Here

        {
            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

            InputStream profile = null;
            try
            {
                profile = ResourceLoader.loadResource( "Resources/colorspace-profiles/CMYK.pf" );
                ICC_Profile iccProfile = ICC_Profile.getInstance( profile );
                cSpace = new ICC_ColorSpace( iccProfile );
            }
            finally
            {
                if( profile != null )
                {
View Full Code Here

                                             palette,
                                             palette);
        } else {
            colorModel =
                ImageCodec.createComponentColorModel(sampleModel,
        iccProfile == null ? null : new ICC_ColorSpace(iccProfile));
        }
    }
View Full Code Here

    private static ColorSpace deserializeColorSpace(ObjectInputStream in)
        throws IOException {
            ColorSpace cs = null;
            int colorSpaceType = in.readInt();
            if(colorSpaceType == COLORSPACE_ICC) {
                cs = new ICC_ColorSpace(ICC_Profile.getInstance(in));
            } else if(colorSpaceType == COLORSPACE_PREDEFINED) {
                cs = ColorSpace.getInstance(in.readInt());
            } else if(colorSpaceType == COLORSPACE_UNKNOWN) {
                // Create probable ColorSpaces for 1- and 3-band cases.
                switch(in.readInt()) {
View Full Code Here

            else
                defaultCs = JAIContext.sRGBColorSpace;

            ColorSpace cs = (profile == null) ?
                    defaultCs :
                    new ICC_ColorSpace(profile);
            ColorModel colorModel =
                    RasterFactory.createComponentColorModel(ri.getSampleModel().getDataType(),
                            cs,
                            false,
                            false,
View Full Code Here

     * none can be determined.
     */
    public static ColorSpace getColorSpaceFrom( ICC_Profile profile,
                                                Raster raster ) {
        if ( profile != null )
            return new ICC_ColorSpace( profile );
        switch ( raster.getSampleModel().getNumBands() ) {
            case 1:
                return gray22ColorSpace;
            case 3:
                return sRGBColorSpace;
View Full Code Here

                if (renderingIntent != LCColorConvertDescriptor.DEFAULT
                    && getRenderingIntent(dstProfile) != renderingIntent.getValue())
                {
                    dstProfile = ICC_Profile.getInstance(dstProfile.getData());
                    setRenderingIntent(dstProfile, renderingIntent.getValue());
                    dst = new ICC_ColorSpace(dstProfile);
                }
            }

            op = new ColorConvertOp(src, dst, null);
View Full Code Here

            final LCJPEGReader reader = new LCJPEGReader(
                imageInfo.getFile().getAbsolutePath(), maxWidth, maxHeight,
                (JPEGImageInfo)imageInfo.getAuxiliaryInfo()
            );
            final PlanarImage image = reader.getImage(
                thread, profile != null ? new ICC_ColorSpace( profile ) : null
            );

            assert image instanceof CachedImage
                    && image.getTileWidth() == JAIContext.TILE_WIDTH
                    && image.getTileHeight() == JAIContext.TILE_HEIGHT;
View Full Code Here

TOP

Related Classes of java.awt.color.ICC_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.