Package java.awt.color

Examples of java.awt.color.ICC_ColorSpace


        return getImageFromBuffer(
            new ArrayByteBuffer( exifSegBuf ),
            dir.getValue( EXIF_JPEG_INTERCHANGE_FORMAT ),
            EXIF_HEADER_START_SIZE,
            dir.getValue( EXIF_JPEG_INTERCHANGE_FORMAT_LENGTH ),
            profile != null ? new ICC_ColorSpace( profile ) : null,
            0, 0
        );
    }
View Full Code Here


        newRendering.setCropAndScale(getCropBounds(), scale);

        PlanarImage image = newRendering.getRendering();

        if (profile != null) {
            final ICC_ColorSpace exportColorSpace =
                profile == JAIContext.sRGBColorProfile
                ? JAIContext.sRGBColorSpace
                : new ICC_ColorSpace(profile);
            if (intent != null)
                image = Functions.toColorSpace(image, exportColorSpace, intent, null);
            else
                image = Functions.toColorSpace(image, exportColorSpace, null);
        }
View Full Code Here

                // nothing
            }
            profile = iccProfile;

            if (profile != null)
                colorSpace = new ICC_ColorSpace(profile);
            else
                switch ( samplesPerPixel - (hasAlpha ? 1 : 0) ) {
                    case 1:
                        colorSpace = JAIContext.gray22ColorSpace;
                        break;
View Full Code Here

            Profile cmsInProfile = new Profile(inProfile);

            BufferedImage inputImage = ImageIO.read(new File("/Stuff/Reference/small-q60-adobergb.TIF"));
            ShortInterleavedRaster inputRaster = (ShortInterleavedRaster) inputImage.getTile(0, 0);

            ColorSpace outCS = new ICC_ColorSpace(outProfile);
            ColorModel outCM = new ComponentColorModel(outCS, false, false,
                                                       Transparency.OPAQUE, DataBuffer.TYPE_USHORT);
            ShortInterleavedRaster outputRaster =
                    (ShortInterleavedRaster) outCM.createCompatibleWritableRaster(inputImage.getWidth(),
                                                                                  inputImage.getHeight());
View Full Code Here

                // Apply ICC Profile to Image by creating a new image with a new
                // color model.
                ICC_Profile iccProf = tryToExctractICCProfile(iiometa);
                if (iccProf != null) {
                    ColorModel cm2 = new ComponentColorModel(
                            new ICC_ColorSpace(iccProf), cm.hasAlpha(), cm
                                    .isAlphaPremultiplied(), cm
                                    .getTransparency(), cm.getTransferType());
                    WritableRaster wr = Raster.createWritableRaster(imageData
                            .getSampleModel(), null);
                    imageData.copyData(wr);
View Full Code Here

                    // FOP URI resolver did not find ICC profile - perhaps the
                    // Java VM can find it?
                    // iccProfile = ICC_Profile.getInstance(iccProfileSrc);
                }
                if (iccProfile != null) {
                    colorSpace = new ICC_ColorSpace(iccProfile);
                }
            } catch (Exception e) {
                // Ignore exception - will be logged a bit further down
                // (colorSpace == null case)
            }
View Full Code Here

        super(info);
        this.red = red;
        this.transparentColor = transparentColor;
        this.colorSpace = red.getColorModel().getColorSpace();
        if (this.colorSpace instanceof ICC_ColorSpace) {
            ICC_ColorSpace icccs = (ICC_ColorSpace) this.colorSpace;
            this.iccProfile = icccs.getProfile();
        } else {
            this.iccProfile = null;
        }
    }
View Full Code Here

    private final ICC_ColorSpace colorSpace;

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

        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

        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

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.