-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of ICCProfile classes
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
greenfield-validation-model/src/main/java/org/verapdf/model/impl/external/GFExternal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...eld-validation-model/src/main/java/org/verapdf/model/impl/external/GFICCInputProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ld-validation-model/src/main/java/org/verapdf/model/impl/external/GFICCOutputProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
greenfield-validation-model/src/main/java/org/verapdf/model/impl/external/GFICCProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |