|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jpl.mipl.mica.tools.BrightnessContrast
public class BrightnessContrast
A BrightnessContrast tool (BnC) is a JavaBean that applies a JAI operator to change the appearance of an ImageChip. The operator is a JAI "Piecewise" operator to perform piecewise-linear remapping of the chip's pixel values. The tool uses this operator to independently control the brightness and contrast of the chip's image.
The tool adds, modifies, or removes the operator by using the ImageChip
setOperation() method. The values of the operator ParameterBlock are read
in from the current set of selected chips. If only one chip is in the set, then the piecewise
point editor is activated and initialized. If no chip is selected, the entire list of
ImageChips is used instead.
When the user clicks one of the brightness or contrast buttons, the appropriate increment or decrement "delta" algorithm is applied to each piecewise point in each chip in the selected set. When the user drags one of the points in the point editor, that point is modified accordingly in the single selected chip.
The "delta" algorithms are modelled on those of the well-known image processing program "XV." A brightness delta of +5% will move all piecewise mapping points 5% closer to the maximum value. A contrast delta of +5% will add a sinusoid to all points where the amplitude is 5% of the maximum value. In pseudocode:
point.y += 0.05*maxYValue * Math.sin( -point.x/maxXValue * 2.0*Math.PI );
BrightnessContrastBeanInfo,
ImageChip,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected PropertyChangeSupport |
butler
A utility object used to manage PropertyChangeListeners. |
protected jpl.mipl.mica.tools.BrightnessContrast.IvjEventHandler |
ivjEventHandler
Instance of the inner class to handle GUI feedback. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
BrightnessContrast()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addNotify()
Adds this tool as a PropertyChangeListener for "Selection" and "Operation" property change events. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to be notified when any bound properties change. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Adds a PropertyChangeListener to be notified when a given bound property changes. |
void |
brightnessDown_ActionPerformed(ActionEvent actionEvent)
Handle button click. |
void |
brightnessUp_ActionPerformed(ActionEvent actionEvent)
Handle button click. |
void |
contrastDown_ActionPerformed(ActionEvent actionEvent)
Handle button click. |
void |
contrastUp_ActionPerformed(ActionEvent actionEvent)
Handle button click. |
static void |
main(String[] args)
main entrypoint - starts the part when it is run as an application |
void |
propertyChange(PropertyChangeEvent evt)
Handles a selection property change or a change to an operator with "BrightnessContrast" as its key value. |
void |
removeNotify()
Removes this tool as a PropertyChangeListener from the MICA system. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
resetButton_ActionPerformed(ActionEvent actionEvent)
Resets all values to their initial state when the reset button is pressed. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PropertyChangeSupport butler
protected jpl.mipl.mica.tools.BrightnessContrast.IvjEventHandler ivjEventHandler
| Constructor Detail |
|---|
public BrightnessContrast()
| Method Detail |
|---|
public void removeNotify()
removeNotify in class JComponentpublic void addNotify()
addNotify in class JComponentpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in class Container
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
addPropertyChangeListener in class Containerpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in class Componentpublic void brightnessUp_ActionPerformed(ActionEvent actionEvent)
public void brightnessDown_ActionPerformed(ActionEvent actionEvent)
public void contrastUp_ActionPerformed(ActionEvent actionEvent)
public void contrastDown_ActionPerformed(ActionEvent actionEvent)
public static void main(String[] args)
args - java.lang.String[]public void resetButton_ActionPerformed(ActionEvent actionEvent)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||