SPDisplacementMapFilter Class Reference
| Inherits from | SPFragmentFilter : NSObject |
| Declared in | SPDisplacementMapFilter.h |
Overview
The SPDisplacementMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. You can use this filter to apply a warped or mottled effect to any object that inherits from the DisplayObject class.
The filter uses the following formula:
dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) * scaleX) / 256,
y + ((componentY(x, y) - 128) * scaleY) / 256]
Tasks
Initialization
-
– initWithMapTexture:Intializes the displacement map filter with the specified map texture.
-
+ displacementMapFilterWithMapTexture:Factory method.
Properties
-
componentXDescribes which color channel to use in the map image to displace the x result.
property -
componentYDescribes which color channel to use in the map image to displace the y result.
property -
scaleXThe multiplier used to scale the x displacement result from the map calculation.
property -
scaleYThe multiplier used to scale the y displacement result from the map calculation.
property -
mapTextureThe texture that will be used to calculate displacement.
property -
mapPointA value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
property -
repeatIndicates how the pixels at the edge of the input image (the filtered object) will be wrapped at the edge.
property
Properties
componentX
Describes which color channel to use in the map image to displace the x result.
@property (nonatomic, assign) SPColorChannel componentXDiscussion
Describes which color channel to use in the map image to displace the x result.
Declared In
SPDisplacementMapFilter.hcomponentY
Describes which color channel to use in the map image to displace the y result.
@property (nonatomic, assign) SPColorChannel componentYDiscussion
Describes which color channel to use in the map image to displace the y result.
Declared In
SPDisplacementMapFilter.hmapPoint
A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
@property (nonatomic, copy) SPPoint *mapPointDiscussion
A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
Declared In
SPDisplacementMapFilter.hmapTexture
The texture that will be used to calculate displacement.
@property (nonatomic, retain) SPTexture *mapTextureDiscussion
The texture that will be used to calculate displacement.
Declared In
SPDisplacementMapFilter.hrepeat
Indicates how the pixels at the edge of the input image (the filtered object) will be wrapped at the edge.
@property (nonatomic, assign) BOOL repeatDiscussion
Indicates how the pixels at the edge of the input image (the filtered object) will be wrapped at the edge.
Declared In
SPDisplacementMapFilter.h