de.matthiasmann.twl.model
Class AbstractColorSpace

java.lang.Object
  extended by de.matthiasmann.twl.model.AbstractColorSpace
All Implemented Interfaces:
ColorSpace
Direct Known Subclasses:
ColorSpaceHSL

public abstract class AbstractColorSpace
extends java.lang.Object
implements ColorSpace

An abstract class to make implementing color spaces a bit easier


Constructor Summary
AbstractColorSpace(java.lang.String colorSpaceName, java.lang.String... names)
           
 
Method Summary
 java.lang.String getColorSpaceName()
           
 java.lang.String getComponentName(int component)
          Returns the name of the specified color component.
 float getMinValue(int component)
          Returns the minimum allowed value for the specified component.
 int getNumComponents()
          Returns the number of component for this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.model.ColorSpace
fromRGB, getComponentShortName, getDefaultValue, getMaxValue, toRGB
 

Constructor Detail

AbstractColorSpace

public AbstractColorSpace(java.lang.String colorSpaceName,
                          java.lang.String... names)
Method Detail

getComponentName

public java.lang.String getComponentName(int component)
Description copied from interface: ColorSpace
Returns the name of the specified color component.

Specified by:
getComponentName in interface ColorSpace
Parameters:
component - the color component index
Returns:
the name of the color component

getColorSpaceName

public java.lang.String getColorSpaceName()
Specified by:
getColorSpaceName in interface ColorSpace

getNumComponents

public int getNumComponents()
Description copied from interface: ColorSpace
Returns the number of component for this model. Must be >= 3.

Specified by:
getNumComponents in interface ColorSpace
Returns:
the number of component for this model. Must be >= 3.

getMinValue

public float getMinValue(int component)
Description copied from interface: ColorSpace
Returns the minimum allowed value for the specified component.

Specified by:
getMinValue in interface ColorSpace
Parameters:
component - the color component index
Returns:
the minimum value