jvx.material

## Class PwAdjustColors

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop
    - - jvx.material.PwAdjustColors

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf

      public class PwAdjustColors
      extends PjWorkshop

  Modify surface color, brightness and contrast in various color modes.
  See Also:
    Serialized Form
  Author:
    Ulrich Reitebuch
  Version:
    09.11.09, 1.10 revised (ur) brightness in hsb mode is now controlled by brightness and contrast.
    05.03.08, 1.00 created (ur)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `HSB` Identifier for Hue-Saturation-Brightness color representation.
    `static int` | `RGB` Identifier for Red-Green-Blue color representation.

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

    - ### Fields inherited from interface jv.project.PjWorkshopIf

      `MODE_BUG, MODE_STANDARD, MODE_VALIDATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PwAdjustColors()` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close Workshop.
    `int` | `getMode()` Set color modifying mode (RGB or HSB).
    `void` | `init()` Initialization.
    `static java.awt.Color[]` | `modifyHSB(java.awt.Color[] col, double hueSummand, double saturationFactor, double brightnessSummand, double contrastFactor)` Modify hue, saturation and brightness values in a color array by translation of the hue value and scaling brightness and saturation values.
    `static java.awt.Color[]` | `modifyRGB(java.awt.Color[] col, double redFactor, double greenFactor, double blueFactor)` Scale color red, green and blue values by given factors.
    `void` | `setGeometry(PgGeometry geom)` Set geometry to work on.
    `void` | `setMode(int mode)` Set color modifying mode to RGB or HSB.
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.

    - ### Methods inherited from class jvx.project.PjWorkshop

      `cancel, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, reset, setDisplay, setDisplays, setModal, setStandalone, setViewer`

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jv.object.PsUpdateIf

      `getFather, getName, setParent`

- - ### Field Detail

    - #### RGB

          public static final int RGB

      Identifier for Red-Green-Blue color representation.
      See Also:
        Constant Field Values

    - #### HSB

          public static final int HSB

      Identifier for Hue-Saturation-Brightness color representation.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PwAdjustColors

          public PwAdjustColors()

      Constructor.

  - ### Method Detail

    - #### init

          public void init()

      Initialization.
      Overrides:
        `init` in class `PjWorkshop`

    - #### setGeometry

          public void setGeometry(PgGeometry geom)

      Set geometry to work on.
      Specified by:
        `setGeometry` in interface `PjWorkshopIf`
      Overrides:
        `setGeometry` in class `PjWorkshop`
      Parameters:
        `geom` - the workshop modifies this geometry.

    - #### close

          public void close()

      Close Workshop.
      Overrides:
        `close` in class `PjWorkshop`

    - #### update

          public boolean update(java.lang.Object event)

      Update the class whenever a child has changed. Method is usually invoked from the children.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PjWorkshop`
      Parameters:
        `event` - sender of this update.
      Returns:
        true if update was correctly handled by superclass.
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### setMode

          public void setMode(int mode)

      Set color modifying mode to RGB or HSB.
      Specified by:
        `setMode` in interface `PjWorkshopIf`
      Overrides:
        `setMode` in class `PjWorkshop`
      Parameters:
        `mode` - either MODE_STANDARD for standard mode, or MODE_BUG for debugging operations.
      See Also:
        `PjWorkshopIf.MODE_STANDARD`

    - #### getMode

          public int getMode()

      Set color modifying mode (RGB or HSB).
      Overrides:
        `getMode` in class `PjWorkshop`
      Returns:
        either MODE_STANDARD for standard mode, or another mode.
      See Also:
        `PjWorkshopIf.MODE_STANDARD`

    - #### modifyHSB

          public static java.awt.Color[] modifyHSB(java.awt.Color[] col,
                                                   double hueSummand,
                                                   double saturationFactor,
                                                   double brightnessSummand,
                                                   double contrastFactor)

      Modify hue, saturation and brightness values in a color array by translation of the hue value and scaling brightness and saturation values.
      Parameters:
        `col` - Input color array
        `hueSummand` - Translation for hue value
        `saturationFactor` - Scaling factor for saturation
        `brightnessSummand` - Translation for brightness
        `contrastFactor` - Scaling Factor for brightness
      Returns:
        Array of modified colors

    - #### modifyRGB

          public static java.awt.Color[] modifyRGB(java.awt.Color[] col,
                                                   double redFactor,
                                                   double greenFactor,
                                                   double blueFactor)

      Scale color red, green and blue values by given factors.
      Parameters:
        `col` - Input color array
        `redFactor` - Scaling factor for red channel
        `greenFactor` - Scaling factor for green channel
        `blueFactor` - Scaling factor for blue channel
      Returns:
        Array of modified colors

"

The software JavaView? is copyright protected. All Rights Reserved.
"