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 intHSBIdentifier for Hue-Saturation-Brightness color representation.static intRGBIdentifier 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 voidclose()Close Workshop.intgetMode()Set color modifying mode (RGB or HSB).voidinit()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.voidsetGeometry(PgGeometry geom)Set geometry to work on.voidsetMode(int mode)Set color modifying mode to RGB or HSB.booleanupdate(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
-
-
Method Detail
-
init
public void init()
Initialization.- Overrides:
initin classPjWorkshop
-
setGeometry
public void setGeometry(PgGeometry geom)
Set geometry to work on.- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geom- the workshop modifies this geometry.
-
close
public void close()
Close Workshop.- Overrides:
closein classPjWorkshop
-
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:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- 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:
setModein interfacePjWorkshopIf- Overrides:
setModein classPjWorkshop- 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:
getModein classPjWorkshop- 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 arrayhueSummand- Translation for hue valuesaturationFactor- Scaling factor for saturationbrightnessSummand- Translation for brightnesscontrastFactor- 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 arrayredFactor- Scaling factor for red channelgreenFactor- Scaling factor for green channelblueFactor- Scaling factor for blue channel- Returns:
- Array of modified colors
-
-
"