Skip to content

Commit

Permalink
Implementation of ICCProfile classes
Browse files Browse the repository at this point in the history
  • Loading branch information
BezrukovM committed Jul 19, 2016
1 parent 9f62a72 commit 6ca2b2a
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
**/target/**
/.idea/**
*.iml

# Eclipse artefacts
**/.project
**/.settings
**/.classpath
**/bin

# Maven artefacts
**/pom.xml.versionsBackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.verapdf.model.impl.external;

import org.verapdf.model.GenericModelObject;
import org.verapdf.model.external.External;

/**
* @author Maksim Bezrukov
*/
public class GFExternal extends GenericModelObject implements External {

protected GFExternal(String type) {
super(type);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.verapdf.model.impl.external;

import org.verapdf.external.ICCProfile;
import org.verapdf.model.external.ICCInputProfile;

/**
* @author Maksim Bezrukov
*/
public class GFICCInputProfile extends GFICCProfile implements ICCInputProfile {

/** Type name for {@code GFICCInputProfile} */
public static final String ICC_INPUT_PROFILE_TYPE = "ICCInputProfile";

/**
* Default constructor.
*
* @param iccProfile iccprofile object of profile
*/
public GFICCInputProfile(ICCProfile iccProfile) {
super(iccProfile, ICC_INPUT_PROFILE_TYPE);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.verapdf.model.impl.external;

import org.verapdf.external.ICCProfile;
import org.verapdf.model.external.ICCOutputProfile;

/**
* @author Maksim Bezrukov
*/
public class GFICCOutputProfile extends GFICCProfile implements ICCOutputProfile {

/** Type name for {@code GFICCOutputProfile} */
public static final String ICC_OUTPUT_PROFILE_TYPE = "ICCOutputProfile";

private String subtype;

/**
* Default constructor
*
* @param profile icc profile object
* @param subtype subtype value for current profile
*/
public GFICCOutputProfile(ICCProfile profile, String subtype) {
super(profile, ICC_OUTPUT_PROFILE_TYPE);
this.subtype = subtype;
}

/**
* @return subtype of output intent, which use current ICC profile
*/
@Override
public String getS() {
return this.subtype;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package org.verapdf.model.impl.external;

import org.verapdf.external.ICCProfile;

/**
* @author Maksim Bezrukov
*/
public class GFICCProfile extends GFExternal implements org.verapdf.model.external.ICCProfile {

private final ICCProfile iccProfile;

protected GFICCProfile(ICCProfile iccProfile, String type) {
super(type);
this.iccProfile = iccProfile;
}

/**
* @return number of colorants for ICC profile, described in profile
* dictionary
*/
@Override
public Long getN() {
return this.iccProfile.getNumberOfColorants();
}

/**
* @return string representation of device class or null, if profile length
* is too small
*/
@Override
public String getdeviceClass() {
return this.iccProfile.getDeviceClass();
}

/**
* @return string representation of color space or null, if profile length
* is too small
*/
@Override
public String getcolorSpace() {
return this.iccProfile.getColorSpace();
}

/**
* @return version of ICC profile or null, if profile length is too small
*/
@Override
public Double getversion() {
return this.iccProfile.getVersion();
}

/**
* Indicate validity of icc profile.
*
* @return true if profile header looks valid
*/
@Override
public Boolean getisValid() {
return this.iccProfile.isLooksValid();
}
}

0 comments on commit 6ca2b2a

Please sign in to comment.