Package java.awt.color

Examples of java.awt.color.ICC_Profile


            new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        ColorProfileInfo cpi =
                            (ColorProfileInfo) printerProfile.getSelectedItem();
                        ICC_Profile profile = cpi.getICCProfile();
                        settings.setColorProfile(profile);
                        engine.preview(settings);
                        Prefs.put(ProofProfileKey, cpi.getName());
                    }
                }
View Full Code Here


        final ImageType t = imageInfo.getImageType();

        options.setExportFile( imageInfo.getFile() );

        try {
            final ICC_Profile profile = t.getICCProfile( imageInfo );
            if ( profile != null ) {
                final String profileName =
                    ColorProfileInfo.getNameOf( profile );
                options.colorProfile.setValue( profileName );
            }
View Full Code Here

        System.loadLibrary("LCMS");
    }

    public static void main(String args[]) {
        try {
            ICC_Profile inProfile = ICC_Profile.getInstance("/System/Library/ColorSync/Profiles/AdobeRGB1998.icc");
            ICC_Profile outProfile = ICC_Profile.getInstance("/Library/ColorSync/Profiles/CIE 1931 D50 Gamma 1.icm");

            Profile cmsOutProfile = new Profile(outProfile);
            Profile cmsInProfile = new Profile(inProfile);

            BufferedImage inputImage = ImageIO.read(new File("/Stuff/Reference/small-q60-adobergb.TIF"));
View Full Code Here

        ImageMetadata meta, ImageFileExportOptions options
    ) {
        if (! (meta.getImageType() instanceof RawImageType)) {
            try {
                ImageInfo info = ImageInfo.getInstanceFor(meta.getFile());
                ICC_Profile profile = info.getImageType().getICCProfile(info);
                String profileName = ColorProfileInfo.getNameOf(profile);
                options.colorProfile.setValue(profileName);
            }
            catch (Throwable t) {
                //   BadImageFileException
View Full Code Here

                profiles.addAll(getColorProfiles(file));
            }
            else if (file.isFile()) {
                String path = file.getAbsolutePath();
                try {
                    ICC_Profile profile = ICC_Profile.getInstance(path);
                    String name = ColorProfileInfo.getNameOf(profile);
                    ColorProfileInfo info = new ColorProfileInfo(name, path);
                    profiles.add(info);
                }
                catch (IOException e) {
View Full Code Here

     * <p> The 'iCCP' chunk will encode this information.
     */
    public void setICCProfileData(byte[] ICCProfileData) {
        this.ICCProfileData = (byte[])(ICCProfileData.clone());
        ICCProfileDataSet = true;
  ICC_Profile profile = ICC_Profile.getInstance(this.ICCProfileData);
  if (!(profile instanceof ICC_ProfileRGB ||
      profile instanceof ICC_ProfileGray))
      return;

  //Set gamma 
View Full Code Here

    private static final String NCP_EXAMPLE_FILE = "ncp-example.icc";

    public void testParser() throws Exception {
        InputStream in = getClass().getResourceAsStream(NCP_EXAMPLE_FILE);
        assertNotNull(NCP_EXAMPLE_FILE + " is missing!", in);
        ICC_Profile iccProfile;
        try {
            iccProfile = ICC_Profile.getInstance(in);
        } finally {
            IOUtils.closeQuietly(in);
        }
View Full Code Here

    private void addsRGBColorSpace() throws IOException {
        if (this.sRGBColorSpace != null) {
            return;
        }
        ICC_Profile profile;
        PDFICCStream sRGBProfile = pdfDoc.getFactory().makePDFICCStream();
        InputStream in = PDFDocument.class.getResourceAsStream("sRGB Color Space Profile.icm");
        if (in != null) {
            try {
                profile = ICC_Profile.getInstance(in);
View Full Code Here

   
    private void addDefaultOutputProfile() throws IOException {
        if (this.outputProfile != null) {
            return;
        }
        ICC_Profile profile;
        InputStream in = null;
        if (this.outputProfileURI != null) {
            this.outputProfile = pdfDoc.getFactory().makePDFICCStream();
            Source src = userAgent.resolveURI(this.outputProfileURI);
            if (src == null) {
View Full Code Here

                } catch (IOException ioe) {
                    throw new IOException("Error while aligning ICC stream: " + ioe.getMessage());
                }
            }

            ICC_Profile iccProfile = null;
            try {
                iccProfile = ColorProfileUtil.getICC_Profile(iccStream.toByteArray());
                if (log.isDebugEnabled()) {
                    log.debug("JPEG has an ICC profile: " + iccProfile.toString());
                }
            } catch (IllegalArgumentException iae) {
                log.warn("An ICC profile is present in the JPEG file but it is invalid ("
                        + iae.getMessage() + "). The color profile will be ignored. ("
                        + info.getOriginalURI() + ")");
                return null;
            }
            if (iccProfile.getNumComponents() != colorSpace.getNumComponents()) {
                log.warn("The number of components of the ICC profile ("
                        + iccProfile.getNumComponents()
                        + ") doesn't match the image ("
                        + colorSpace.getNumComponents()
                        + "). Ignoring the ICC color profile.");
                return null;
            } else {
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.