Package java.awt.color

Examples of java.awt.color.ICC_Profile


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


    IccProfileParser parser = new IccProfileParser();
    IccProfileInfo info = parser.getICCProfileInfo(bytes);
    if (info.issRGB())
      return null;

    ICC_Profile icc = ICC_Profile.getInstance(bytes);
    return icc;
  }
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

      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

            }
        } finally {
            in.reset();
        }
       
        ICC_Profile iccProfile = buildICCProfile(info, colorSpace, iccStream);
        if (iccProfile == null && colorSpace == null) {
            throw new ImageException("ColorSpace not be identified for JPEG image " + info);
        }

        boolean invertImage = false;
View Full Code Here

                    iccStream.write(new byte[padding]);
                } catch (IOException ioe) {
                    throw new IOException("Error while aligning ICC stream: " + ioe.getMessage());
                }
            }
            ICC_Profile iccProfile = null;
            try {
                iccProfile = ICC_Profile.getInstance(iccStream.toByteArray());
                log.debug("JPEG has an ICC profile: " + iccProfile.toString());
            } catch (IllegalArgumentException iae) {
                log.warn("An ICC profile is present 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

            return null;

        // Now that we have a profile element,
        // try to load the corresponding ICC profile xlink:href
        String href = XLinkSupport.getXLinkHref(profile);
        ICC_Profile p = null;
        if (href != null) {
            String baseURI = ((AbstractNode) profile).getBaseURI();
            ParsedURL pDocURL = null;
            if (baseURI != null) {
                pDocURL = new ParsedURL(baseURI);
View Full Code Here

            return null;

        // Now that we have a profile element,
        // try to load the corresponding ICC profile xlink:href
        String href = XLinkSupport.getXLinkHref(profile);
        ICC_Profile p = null;
        if (href != null) {
            String baseURI= ((SVGOMDocument)doc).getURL();
            ParsedURL purl = new ParsedURL(baseURI, href);
            if (!purl.complete())
                throw new BridgeException(paintedElement, ERR_URI_MALFORMED,
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

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.