Package org.cip4.jdflib.datatypes
Class JDFLabColor
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<java.lang.Object>
-
- org.cip4.jdflib.datatypes.JDFNumList
-
- org.cip4.jdflib.datatypes.JDFLabColor
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Object>,java.util.Collection<java.lang.Object>,java.util.List<java.lang.Object>,java.util.RandomAccess,JDFBaseDataTypes
public class JDFLabColor extends JDFNumList
This class is a representation of a Lab color (JDFLabColor). It is a blank separated list of double values consisting of L, a and b value.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cip4.jdflib.datatypes.JDFNumList
JDFNumList.NormComparator, JDFNumList.VolumeComparator
-
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue
-
-
Field Summary
-
Fields inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
EPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION
-
-
Constructor Summary
Constructors Constructor Description JDFLabColor()constructs a Lab color with all values set to 0.0 DoubleJDFLabColor(double l, double a, double b)constructs a new Lab color with the given double valuesJDFLabColor(java.lang.String s)constructs a Lab color with all values set via a StringJDFLabColor(java.util.Vector v)Deprecated.use typesafe constructorsJDFLabColor(JDFLabColor nl)constructs a Lab color with all values set via a JDFNumberList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JDFLabColorcreateLabColor(java.lang.String s)factory for JDFShape that silently returns null in case of illegal stringsdoubledeltaE(JDFLabColor other)simple lab distance disregarding all the new fangled calculationsdoublegetA()getA - returns the value a of the Lab colordoublegetB()getB - returns the value b of the Lab colordoublegetL()getL - returns the value L of the Lab colorbooleanisValid()isValid - true if the size of the vector is 3 and all objects are Double typesvoidsetA(double a)setA - sets the value a of the Lab colorvoidsetB(double b)setB - sets the value b of the Lab colorvoidsetL(double l)setL - sets the value L of the Lab color-
Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, equals, getDouble, getDoubleList, getDoubleVector, getIntArray, getString, getString, hashCode, intAt, isValidString, matches, max, min, norm, removeElementAt, replaceElementAt, scale, scale, scaleFromCM, scaleFromCM, scaleFromMM, scaleFromMM, scaleToCM, scaleToCM, scaleToMM, scaleToMM, set, setString, setX, shift, sort, subtract, toString, unify, volume
-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, forEach, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
JDFLabColor
public JDFLabColor()
constructs a Lab color with all values set to 0.0 Double
-
JDFLabColor
@Deprecated public JDFLabColor(java.util.Vector v) throws java.util.zip.DataFormatExceptionDeprecated.use typesafe constructorsconstructs a Lab color with all values set via a Vector of Double objects- Parameters:
v- the given vector- Throws:
java.util.zip.DataFormatException- - if the Vector has not a valid format
-
JDFLabColor
public JDFLabColor(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs a Lab color with all values set via a String- Parameters:
s- the given String- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFLabColor
public JDFLabColor(JDFLabColor nl)
constructs a Lab color with all values set via a JDFNumberList- Parameters:
nl- the given number list- Throws:
java.util.zip.DataFormatException- - if the String does not have a valid format
-
JDFLabColor
public JDFLabColor(double l, double a, double b)constructs a new Lab color with the given double values- Parameters:
l- the value La- the value ab- the value b
-
-
Method Detail
-
createLabColor
public static JDFLabColor createLabColor(java.lang.String s)
factory for JDFShape that silently returns null in case of illegal strings- Parameters:
s- the string to parse - if JDFXYPair compatible, a 0 z dimension value is assumed- Returns:
- the JDFShape, null if s is not compatible
-
isValid
public boolean isValid() throws java.util.zip.DataFormatExceptionisValid - true if the size of the vector is 3 and all objects are Double types- Specified by:
isValidin classJDFNumList- Returns:
- boolean - true if all instances are Double or Integer types
- Throws:
java.util.zip.DataFormatException- - if the Vector has not a valid format
-
getL
public double getL()
getL - returns the value L of the Lab color- Returns:
- double - the value L of the Lab color
-
setL
public void setL(double l)
setL - sets the value L of the Lab color- Parameters:
l- the value L of the Lab color
-
getA
public double getA()
getA - returns the value a of the Lab color- Returns:
- double - the value a of the Lab color
-
setA
public void setA(double a)
setA - sets the value a of the Lab color- Parameters:
a- the value a of the Lab color
-
getB
public double getB()
getB - returns the value b of the Lab color- Returns:
- double - the value b of the Lab color
-
setB
public void setB(double b)
setB - sets the value b of the Lab color- Parameters:
b- the value b of the Lab color
-
deltaE
public double deltaE(JDFLabColor other)
simple lab distance disregarding all the new fangled calculations- Parameters:
other-- Returns:
-
-