public class HFlatEffectMatte extends Object implements HMatte, HAnimateEffect
HFlatEffectMatte class
represents a matte that is constant over space but varies over
time. It is specified as a sequence of floating point values
in the range 0.0 to 1.0 where:
The data for any HFlatEffectMatte may be changed "on the fly"
using the setMatteData method.
However, some implementations may be asynchronously referencing
their content (i.e. through a separate implementation-specific
animation thread). Therefore the following restrictions apply to
the setMatteData method:
| Parameter | Description | Default value | Set method | Get method |
|---|---|---|---|---|
| data | The transparency value for this flat effect matte. | null (the matte should be treated as being temporally unvarying and opaque) | setMatteData |
getMatteData |
| Description | Default value | Set method | Get method |
|---|---|---|---|
| The initial piece of content to be presented, i.e. its position in the content array. | 0 | setPosition |
getPosition |
| By default the animation should be stopped. Hence, to start the animation its start method must be explicitly invoked. This mechanism allows for animations that are programmatically controlled, e.g. via the setPosition method. | "stopped" | start /
stop |
isAnimated |
PLAY_ALTERNATING, PLAY_REPEATING, REPEAT_INFINITE| Constructor and Description |
|---|
HFlatEffectMatte()
Creates an
HFlatEffectMatte object. |
HFlatEffectMatte(float[] data)
Creates an
HFlatEffectMatte object. |
| Modifier and Type | Method and Description |
|---|---|
int |
getDelay()
Gets the presentation delay for this
HFlatEffectMatte. |
float[] |
getMatteData()
Returns the matte data used for this matte.
|
int |
getPlayMode()
Gets the playing mode for this
HFlatEffectMatte. |
int |
getPosition()
Get the current index into the content array which this
HFlatEffectMatte is using to display
content. |
int |
getRepeatCount()
Gets the number of times that this
HFlatEffectMatte is to be played. |
boolean |
isAnimated()
This method indicates the animation (running) state of the
HFlatEffectMatte. |
void |
setDelay(int count)
Sets the delay between the presentation of successive pieces of
content (frames).
|
void |
setMatteData(float[] data)
Sets the data for this matte.
|
void |
setPlayMode(int mode)
Sets the playing mode for this
HFlatEffectMatte. |
void |
setPosition(int position)
Set this
HFlatEffectMatte to
display the content at the specified position. |
void |
setRepeatCount(int count)
Sets the number of times that this
HFlatEffectMatte should be played. |
void |
start()
This method starts this
HFlatEffectMatte playing. |
void |
stop()
This method indicates that the running
HFlatEffectMatte should be
stopped. |
public HFlatEffectMatte()
HFlatEffectMatte object. See the class description for details
of constructor parameters and default values.public HFlatEffectMatte(float[] data)
HFlatEffectMatte object. See the class description for details
of constructor parameters and default values.public void setMatteData(float[] data)
data - the data for this matte. Specify a null object to
remove the associated data for this matte. If the length of the
data array is zero, an IllegalArgumentException is thrown.public float[] getMatteData()
public void start()
HFlatEffectMatte playing. If start is called when
the animation is already running it resets the animation
according to the current play mode, as returned by getPlayMode.start in interface HAnimateEffectpublic void stop()
HFlatEffectMatte should be
stopped. After calling this method, there is no guarantee that
one or more frames will not be displayed before the animation
actually stops playing. If the animation is already stopped
further calls to stop have no effect.stop in interface HAnimateEffectpublic boolean isAnimated()
HFlatEffectMatte.isAnimated in interface HAnimateEffecttrue if this HFlatEffectMatte is running, i.e. the start method
has been invoked - false otherwise.public void setPosition(int position)
HFlatEffectMatte to
display the content at the specified position. If the animation
is already running a call to setPosition will
change the current value and affect the animation immediately.setPosition in interface HAnimateEffectposition - an index into the content array which specifies
the next piece of content to be displayed. If
position is less than 0, then the array element at
index 0 is displayed, if position is greater than
or equal to the length of the content array, then the array
element at index [length-1] will be used.public int getPosition()
HFlatEffectMatte is using to display
content.getPosition in interface HAnimateEffect0 <= index < lengthpublic void setRepeatCount(int count)
HFlatEffectMatte should be played.
If the animation is already running a call to
setRepeatCount will change the current value and
reset the current number of repeats to 0, affecting the
animation immediately.setRepeatCount in interface HAnimateEffectcount - the number of times that an HFlatEffectMatte should be
played. Valid values of the repeat count are one or more, and
REPEAT_INFINITE.public int getRepeatCount()
HFlatEffectMatte is to be played. Note that this method does not
return the number of repeats that are remaining to be played.
Except for HAnimateEffect implementations that specify a
different default, getRepeatCount() returns
REPEAT_INFINITE if no call to
setRepeatCount() has previously been made.
getRepeatCount in interface HAnimateEffectHFlatEffectMatte is to be played. The
returned value shall be greater than zero, or REPEAT_INFINITE.public void setDelay(int count)
After calling setDelay on a currently playing HFlatEffectMatte, there is no
guarantee that one or more frames will not be displayed using
the previous delay until the new delay value takes effect.
setDelay in interface HAnimateEffectcount - the content presentation delay in units of 0.1
seconds duration. If count is less than one "unit",
then it shall be treated as if it were a delay of one
"unit", i.e. 0.1 seconds.public int getDelay()
HFlatEffectMatte.getDelay in interface HAnimateEffectpublic void setPlayMode(int mode)
HFlatEffectMatte. If the animation is already running a call to
setPlayMode will change the current value and
affect the animation immediately. The position of the animation
is unchanged.setPlayMode in interface HAnimateEffectmode - the play mode for this HFlatEffectMatte, which must be either HAnimateEffect.PLAY_ALTERNATING or HAnimateEffect.PLAY_REPEATING.public int getPlayMode()
HFlatEffectMatte.getPlayMode in interface HAnimateEffectHFlatEffectMatte.Copyright © 2012 code4tv.com. All Rights Reserved.