org.geotools.styling
Class ContrastEnhancementImpl

Object
  extended by ContrastEnhancementImpl
All Implemented Interfaces:
ContrastEnhancement

public class ContrastEnhancementImpl
extends Object
implements ContrastEnhancement

The ContrastEnhancement object defines contrast enhancement for a channel of a false-color image or for a color image. Its format is:

 <xs:element name="ContrastEnhancement">
   <xs:complexType>
     <xs:sequence>
       <xs:choice minOccurs="0">
         <xs:element ref="sld:Normalize"/>
         <xs:element ref="sld:Histogram"/>
       </xs:choice>
       <xs:element ref="sld:GammaValue" minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 <xs:element name="Normalize">
   <xs:complexType/>
 </xs:element>
 <xs:element name="Histogram">
   <xs:complexType/>
 </xs:element>
 <xs:element name="GammaValue" type="xs:double"/>
 
In the case of a color image, the relative grayscale brightness of a pixel color is used. ?Normalize? means to stretch the contrast so that the dimmest color is stretched to black and the brightest color is stretched to white, with all colors in between stretched out linearly. ?Histogram? means to stretch the contrast based on a histogram of how many colors are at each brightness level on input, with the goal of producing equal number of pixels in the image at each brightness level on output. This has the effect of revealing many subtle ground features. A ?GammaValue? tells how much to brighten (value greater than 1.0) or dim (value less than 1.0) an image. The default GammaValue is 1.0 (no change). If none of Normalize, Histogram, or GammaValue are selected in a ContrastEnhancement, then no enhancement is performed.

Author:
iant

Constructor Summary
ContrastEnhancementImpl()
           
ContrastEnhancementImpl(ContrastEnhancement contrastEnhancement)
           
ContrastEnhancementImpl(FilterFactory factory)
           
ContrastEnhancementImpl(FilterFactory2 factory, Expression gamma, ContrastMethod method)
           
ContrastEnhancementImpl(FilterFactory factory, ContrastMethod method)
           
 
Method Summary
 void accept(StyleVisitor visitor)
          Traversal of the style data structure.
 Object accept(StyleVisitor visitor, Object extraData)
          calls the visit method of a StyleVisitor
 boolean equals(Object obj)
           
 Expression getGammaValue()
          How much to brighten (values greater than 1.0) or dim (values less than 1.0) an image.
 ContrastMethod getMethod()
          We use a codeList to enable more enchancement type possibilities.
 Expression getType()
          Returns a literal expression (one of NORMALIZE, HISTOGRAM, NONE) indicating which ContrastMethod value is to be used.
 int hashCode()
           
 void setExponential()
           
 void setFilterFactory(FilterFactory factory)
           
 void setGammaValue(Expression gamma)
           
 void setHistogram()
           
 void setLogarithmic()
           
 void setMethod(ContrastMethod method)
          Used to set the contrast enhancement method used.
 void setNormalize()
           
 void setType(Expression type)
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContrastEnhancementImpl

public ContrastEnhancementImpl()

ContrastEnhancementImpl

public ContrastEnhancementImpl(FilterFactory factory)

ContrastEnhancementImpl

public ContrastEnhancementImpl(FilterFactory factory,
                               ContrastMethod method)

ContrastEnhancementImpl

public ContrastEnhancementImpl(ContrastEnhancement contrastEnhancement)

ContrastEnhancementImpl

public ContrastEnhancementImpl(FilterFactory2 factory,
                               Expression gamma,
                               ContrastMethod method)
Method Detail

setFilterFactory

public void setFilterFactory(FilterFactory factory)

getGammaValue

public Expression getGammaValue()
Description copied from interface: ContrastEnhancement
How much to brighten (values greater than 1.0) or dim (values less than 1.0) an image. The default GammaValue is 1.0 (no change).

Specified by:
getGammaValue in interface ContrastEnhancement
Returns:
Expression, if null a value of 1.0 is assumed indicating no change

getType

public Expression getType()
Description copied from interface: ContrastEnhancement
Returns a literal expression (one of NORMALIZE, HISTOGRAM, NONE) indicating which ContrastMethod value is to be used.


setGammaValue

public void setGammaValue(Expression gamma)
Parameters:
gamma - How much to brighten (greater than 1) or dim (less than 1) this channel; use 1.0 to indicate no change.

setHistogram

public void setHistogram()

setNormalize

public void setNormalize()

setLogarithmic

public void setLogarithmic()

setExponential

public void setExponential()

setType

public void setType(Expression type)
Parameters:
type - Should be a Literal of "Normalize" or "Histogram" or "None", if null supplied "None" is assumed

setMethod

public void setMethod(ContrastMethod method)
Description copied from interface: ContrastEnhancement
Used to set the contrast enhancement method used.


getMethod

public ContrastMethod getMethod()
Description copied from interface: ContrastEnhancement
We use a codeList to enable more enchancement type possibilities.

Specified by:
getMethod in interface ContrastEnhancement

accept

public Object accept(StyleVisitor visitor,
                     Object extraData)
Description copied from interface: ContrastEnhancement
calls the visit method of a StyleVisitor

Specified by:
accept in interface ContrastEnhancement
Parameters:
visitor - the style visitor

accept

public void accept(StyleVisitor visitor)
Description copied from interface: ContrastEnhancement
Traversal of the style data structure.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 1996-2014 Geotools. All Rights Reserved.