com.levigo.jadice.document.render
Class ImageRenderSettings

java.lang.Object
  extended by com.levigo.jadice.document.render.AbstractListenableRenderSettings
      extended by com.levigo.jadice.document.render.ImageRenderSettings
All Implemented Interfaces:
ProcessingSettings, RenderSettings, Serializable

public class ImageRenderSettings
extends AbstractListenableRenderSettings

A ProcessingSettings type which controls various aspects of the image rendering process like desaturation, gradation or image filtering.

See Also:
Serialized Form

Field Summary
static String DESATURATION
          Identifier key for a desaturation change, used within a RenderSettingsEvent to recognize the kind of change which happen.
static String FILTER
          Identifier key for a filter change, used within a RenderSettingsEvent to recognize the kind of change which happen.
static String GRADATION_CURVE
          Identifier key for a gradation change, used within a RenderSettingsEvent to recognize the kind of change which happen.
static String LAYER_APPLICABILITY
          Property prefix key for a change to the setAppliesToLayer(DocumentLayer, boolean)/ isAppliesToLayer(DocumentLayer) property.
static String USE_UPSCALING
          Identifier key for a change to the setUseUpscalingFilter(boolean)/ isUseUpscalingFilter() property.
 
Constructor Summary
ImageRenderSettings()
          Constructor
 
Method Summary
 void applyToAllLayers()
          Sets this settings instance to apply to all document layers.
 ImageRenderSettings createSnapshot()
          Creates and returns a snapshot copy of this settings instance.
 boolean equals(Object obj)
           
 FilterType getFilterType()
          Returns the filter type to be applied.
 GradationCurve getGradationCurve()
          Returns the gradation curve to be applied to the image.
 int hashCode()
           
 boolean isAppliesToLayer(DocumentLayer layer)
          Returns whether this settings instance applies to the given document layer.
 boolean isDesaturate()
          Returns whether the desaturation is activated
 boolean isUseUpscalingFilter()
           
 void setAppliesToLayer(DocumentLayer layer, boolean value)
          Set whether this ImageRenderSettings instance shall apply to the given document layer or not.
 void setDesaturate(boolean desaturate)
          Changes whether desaturation is active or not.
 void setFilterType(FilterType filterType)
          Changes the filter type to be applied.
 void setGradationCurve(GradationCurve gradationCurve)
          Sets the gradation curve to be applied to the image.
 void setUseUpscalingFilter(boolean useUpscalingFilter)
          Set whether to use the filter type set via setFilterType(FilterType) to up-sample (scale larger than original size) images also.
 void update(String propertyName, RenderSettings other, Object... details)
          Updates this instance property specified by given property name with the value provided by the other processing setting.
 
Methods inherited from class com.levigo.jadice.document.render.AbstractListenableRenderSettings
fireChanged, getSettingsChangeHandler, setSettingsChangeHandler
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRADATION_CURVE

public static final String GRADATION_CURVE
Identifier key for a gradation change, used within a RenderSettingsEvent to recognize the kind of change which happen.

See Also:
Constant Field Values

DESATURATION

public static final String DESATURATION
Identifier key for a desaturation change, used within a RenderSettingsEvent to recognize the kind of change which happen.

See Also:
Constant Field Values

FILTER

public static final String FILTER
Identifier key for a filter change, used within a RenderSettingsEvent to recognize the kind of change which happen.

See Also:
Constant Field Values

USE_UPSCALING

public static final String USE_UPSCALING
Identifier key for a change to the setUseUpscalingFilter(boolean)/ isUseUpscalingFilter() property.

See Also:
Constant Field Values

LAYER_APPLICABILITY

public static final String LAYER_APPLICABILITY
Property prefix key for a change to the setAppliesToLayer(DocumentLayer, boolean)/ isAppliesToLayer(DocumentLayer) property. The actual property key is derived by appending "." and the layer name to this prefix.

See Also:
Constant Field Values
Constructor Detail

ImageRenderSettings

public ImageRenderSettings()
Constructor

Method Detail

createSnapshot

public ImageRenderSettings createSnapshot()
Creates and returns a snapshot copy of this settings instance.

Returns:
snapshot copy

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

getGradationCurve

public GradationCurve getGradationCurve()
Returns the gradation curve to be applied to the image.

Returns:
gradation curve

setGradationCurve

public void setGradationCurve(GradationCurve gradationCurve)
Sets the gradation curve to be applied to the image. The gradation curve may not be null. to create an identity gradation use the default constructor GradationCurve.GradationCurve().

Parameters:
gradationCurve - the new gradation curve

isDesaturate

public boolean isDesaturate()
Returns whether the desaturation is activated

Returns:
desaturation state

setDesaturate

public void setDesaturate(boolean desaturate)
Changes whether desaturation is active or not.

Parameters:
desaturate - true for active, otherwise false

getFilterType

public FilterType getFilterType()
Returns the filter type to be applied.

Returns:
FilterType

setFilterType

public void setFilterType(FilterType filterType)
Changes the filter type to be applied. The filter type may not be null. To clear prior filter type changes, use FilterType.getDefaultFilterType() as new filter.

Parameters:
filterType -

update

public void update(String propertyName,
                   RenderSettings other,
                   Object... details)
Description copied from interface: RenderSettings
Updates this instance property specified by given property name with the value provided by the other processing setting. For each update-supported property the render settings type have to provide a unique property name.

Parameters:
propertyName - the name of the property to update. Update supported properties have unique property identifier provided by the specific render settings implementation.
other - the processing setting which provide the new property value. Therefore the other processing setting have to be of the same type as this instance.
details - (optional) if some describing details are necessary to do a specific update, the details parameter will transport this informations

setUseUpscalingFilter

public void setUseUpscalingFilter(boolean useUpscalingFilter)
Set whether to use the filter type set via setFilterType(FilterType) to up-sample (scale larger than original size) images also. If set to true the scaling filter is used to create images larger than original size resulting in a smooth appearance. If set to false, the image is up-scaled on the fly during rendering using a simple nearest-neighbor interpolation resulting in a jagged appearance but reduced rendering time and memory consumption.

Parameters:
useUpscalingFilter -

isUseUpscalingFilter

public boolean isUseUpscalingFilter()
See Also:
setUseUpscalingFilter(boolean)

setAppliesToLayer

public void setAppliesToLayer(DocumentLayer layer,
                              boolean value)
Set whether this ImageRenderSettings instance shall apply to the given document layer or not.

Parameters:
layer - the document layer.
value - true if this settings instance shall apply to the given layer

isAppliesToLayer

public boolean isAppliesToLayer(DocumentLayer layer)
Returns whether this settings instance applies to the given document layer.

Parameters:
layer - the document layer
Returns:
whether this settings instance shall apply to the layer

applyToAllLayers

public void applyToAllLayers()
Sets this settings instance to apply to all document layers.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.