Class Effect
java.lang.Object
com.codename1.art.effects.Effect
An effect: a kind and its parameters.
Parameters are numbers (Float), colors (Integer, 0xAARRGGBB), number arrays
(float[]), color arrays (int[]), strings, BlendModes, Rasters and, for SVG
filters, lists of primitives (each a Map). Every kind is described in Effects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBlur of what is behind the layer, seen through it.static final StringBevel and emboss.static final StringGrayscale with per-hue weights.static final StringBrightness and contrast.static final StringOutput channels mixed from the input channels.static final StringShifts colors toward red, green or blue separately in shadows, midtones and highlights.static final StringA 4x5 color matrix.static final StringSolid color over the layer.static final StringTone curves.static final StringShadow behind the layer.static final StringExposure, offset and gamma.static final StringGaussian blur of the layer.static final StringLuminance mapped through a gradient.static final StringGradient over the layer.static final StringHue, saturation and lightness.static final StringGlow inside the layer's edges.static final StringShadow inside the layer's edges.static final StringInverted colors.static final StringInput and output levels with gamma.static final StringBlur along a direction.static final StringGlow around the layer.static final StringPattern over the layer.static final StringA colored filter over the image.static final StringFewer tones per channel.static final StringSatin shading.static final StringChanges the ink of chosen color ranges, as Photoshop's selective color does.static final StringOutline around the layer's edges.static final StringAn SVG filter graph.static final StringBlack and white at a threshold.static final StringSaturation boost that spares saturated colors.static final StringA blur radiating from a point, as a camera zooming during the exposure. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Raster layer, EffectContext ctx) Applies the effect.copy()A deep copy.The blend mode parameterblend.intA color parameter.int[]A color array parameter.floatA number parameter.float[]A number array parameter.getKind()The kind.The parameters that have been set.The SVG filter primitives, or an empty list.A raster parameter, or null.A string parameter.booleanFalse keeps the effect but does not apply it.intpadding(double scale) How far, in device pixels, the effect can paint outside the layer's content.Sets a number parameter and returns this effect.Sets a parameter and returns this effect.Sets a color parameter and returns this effect.voidsetEnabled(boolean enabled) Turns the effect on or off.
-
Field Details
-
DROP_SHADOW
-
INNER_SHADOW
-
OUTER_GLOW
-
INNER_GLOW
-
GAUSSIAN_BLUR
-
BACKGROUND_BLUR
Blur of what is behind the layer, seen through it.- See Also:
-
MOTION_BLUR
-
ZOOM_BLUR
A blur radiating from a point, as a camera zooming during the exposure.- See Also:
-
STROKE
-
COLOR_OVERLAY
-
GRADIENT_OVERLAY
-
PATTERN_OVERLAY
-
BEVEL
-
SATIN
-
COLOR_MATRIX
-
LEVELS
-
CURVES
-
HUE_SATURATION
-
BRIGHTNESS_CONTRAST
-
INVERT
-
THRESHOLD
-
GRADIENT_MAP
-
CHANNEL_MIXER
-
PHOTO_FILTER
-
POSTERIZE
-
EXPOSURE
-
VIBRANCE
-
BLACK_AND_WHITE
-
COLOR_BALANCE
Shifts colors toward red, green or blue separately in shadows, midtones and highlights.- See Also:
-
SELECTIVE_COLOR
Changes the ink of chosen color ranges, as Photoshop's selective color does.- See Also:
-
SVG_FILTER
-
-
Constructor Details
-
Effect
Creates an effect with no parameters set; every parameter then has its default.
Parameters
kind: one of the kind constants
-
-
Method Details
-
getKind
The kind. -
isEnabled
public boolean isEnabled()False keeps the effect but does not apply it. -
setEnabled
public void setEnabled(boolean enabled) Turns the effect on or off.
Parameters
enabled: true to apply it
-
getParameters
-
set
-
set
-
setColor
-
getFloat
A number parameter.
Parameters
name: the parameterdef: the value when it is not set
-
getColor
A color parameter.
Parameters
name: the parameterdef: the value when it is not set
-
getString
-
getFloats
A number array parameter.
Parameters
name: the parameterdef: the value when it is not set
-
getColors
A color array parameter.
Parameters
name: the parameterdef: the value when it is not set
-
getBlend
-
getRaster
-
getPrimitives
-
copy
A deep copy. -
apply
Applies the effect.
Parameters
layer: the layer's pixels in device spacectx: the scale and backdrop
Returns
the new pixels, possibly a larger raster;
layeris not changed -
padding
public int padding(double scale) How far, in device pixels, the effect can paint outside the layer's content.
Parameters
scale: device pixels per unit
-