Package java.awt.color

Examples of java.awt.color.ICC_Profile


            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


            Sanselan.writeImage(image, os, format, optional_params);

            // <b>get the image's embedded ICC Profile, if it has one. </b>
            byte iccProfileBytes[] = Sanselan.getICCProfileBytes(imageBytes);

            ICC_Profile iccProfile = Sanselan.getICCProfile(imageBytes);

            // <b>get the image's width and height. </b>
            Dimension d = Sanselan.getImageSize(imageBytes);

            // <b>get all of the image's info (ie. bits per pixel, size, transparency, etc.) </b>
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

            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

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

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

        InputStream profile = null;
        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

        {
            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

    public void setJobName(String name) {
        jobName = name;
    }

    public void print(ImageEditorEngine engine, ProgressThread thread, PageFormat format, PrintSettings settings) throws PrinterException {
        ICC_Profile colorProfile = settings.getColorProfile() != null
                                   ? settings.getColorProfile()
                                   : JAIContext.sRGBColorProfile;

        MacOSXPrinter.setPageFormat( format );

        // In Cocoa there is no way of really controlling the print resolution,
        // we always print at full size and then rely on the printer to do the appropriate scaling...

        RenderedImage rendering = engine.getRendering(engine.getNaturalSize(),
                                                      colorProfile,
                                                      engine.getLCMSIntent(settings.getRenderingIntent()),
                                                      true);

        try {
            File spoolFile = File.createTempFile("LZPrintSpool", "tif");
            LCTIFFWriter writer = new LCTIFFWriter(spoolFile.getAbsolutePath(),
                                                   rendering.getWidth(),
                                                   rendering.getHeight());
            // No profile for Application Managed Colors
            if (colorProfile == JAIContext.sRGBColorProfile)
                writer.setByteField( TIFFTags.TIFF_ICC_PROFILE, colorProfile.getData());
            writer.putImageStriped(rendering, thread);

            if (!thread.isCanceled())
                MacOSXPrinter.print(jobName, spoolFile, settings.getPrintBounds());
View Full Code Here

        }

        RenderedImage source = null;
        RenderedImage dest = null;
        if ( imageFile.exists() && imageFile.canRead() ) {
            ICC_Profile profile = null;
            RenderedImage ri = null;

            try {
                ImageInfo imageInfo = ImageInfo.getInstanceFor( imageFile );
                ri = imageInfo.getImage( null );
View Full Code Here

TOP

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