Examples of ICC_ColorSpace


Examples of java.awt.color.ICC_ColorSpace

     * 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

Examples of java.awt.color.ICC_ColorSpace

                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

Examples of java.awt.color.ICC_ColorSpace

            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

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

Examples of java.awt.color.ICC_ColorSpace

        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

Examples of java.awt.color.ICC_ColorSpace

                // 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

Examples of java.awt.color.ICC_ColorSpace

            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

Examples of java.awt.color.ICC_ColorSpace

                // 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

Examples of java.awt.color.ICC_ColorSpace

                    // 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

Examples of java.awt.color.ICC_ColorSpace

        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
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.