Example usage for java.awt.color ICC_Profile getData

List of usage examples for java.awt.color ICC_Profile getData

Introduction

In this page you can find the example usage for java.awt.color ICC_Profile getData.

Prototype

public byte[] getData(int tagSignature) 

Source Link

Document

Returns a particular tagged data element from the profile as a byte array.

Usage

From source file:Main.java

/**
 * Used in ICC_Transform class to check the rendering intent of the profile
 * @param profile - ICC profile/*from  w  w w  .ja  v  a2  s  . c  o  m*/
 * @return rendering intent
 */
public static int getRenderingIntent(ICC_Profile profile) {
    return getIntFromByteArray(profile.getData(ICC_Profile.icSigHead), // pf header
            ICC_Profile.icHdrRenderingIntent);
}

From source file:org.sejda.sambox.pdmodel.graphics.color.PDICCBased.java

/**
 * Returns true if the given profile is represents sRGB.
 *//*from  w  w  w  .  ja v a2s. c  o  m*/
private boolean is_sRGB(ICC_Profile profile) {
    byte[] bytes = Arrays.copyOfRange(profile.getData(ICC_Profile.icSigHead), ICC_Profile.icHdrModel,
            ICC_Profile.icHdrModel + 7);
    String deviceModel = new String(bytes, StandardCharsets.US_ASCII).trim();
    return deviceModel.equals("sRGB");
}