com.aliyun.svideosdk.editor.impl

## Class AliyunPasterControllerCompoundCaption

- java.lang.Object
- - AliyunIPasterPackageOperation
  - - com.aliyun.svideosdk.editor.impl.AliyunPasterAbstractController<AliyunCaption>
    - - com.aliyun.svideosdk.editor.impl.AliyunPasterControllerCompoundCaption

- All Implemented Interfaces:
    AliyunIPasterController

      public class AliyunPasterControllerCompoundCaption
      extends AliyunPasterAbstractController<AliyunCaption>

  The caption controller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AlignCenter`
    `static int` | `AlignLeft`
    `static int` | `AlignRight`

    - ### Fields inherited from class com.aliyun.svideosdk.editor.impl.AliyunPasterAbstractController

      `mModel, mRender`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addFrameAnimation(ActionBase action)` Adds an animation to a stream or material.
    `int` | `apply()`
    `int` | `clearFrameAnimation()` Clear Animation
    `AliyunColor` | `getBackgroundColor()` Get the background color of caption Added in v3.23.0
    `float` | `getBackgroundCornerRadius()` Get the background radius of caption Added in v3.31.0
    `java.lang.String` | `getBubbleEffectTemplate()` Deprecated. Use `getBubbleEffectTemplateSource()` instead.
    `ISource` | `getBubbleEffectTemplateSource()` Get the template Source for bubble text Added in v3.23.0
    `AliyunColor` | `getColor()` Get the text color of caption Added in v3.22.0
    `long` | `getDuration()` Get Caption Render Duration in microsecond
    `java.lang.String` | `getFontEffectTemplate()` Deprecated. Use `getFontEffectTemplateSource()` instead.
    `ISource` | `getFontEffectTemplateSource()` Get the template Source for font effect Added in v3.23.0
    `ISource` | `getFontPath()` Get Font Source Added in v3.24.0
    `AliyunFontStyle` | `getFontStyle()` Deprecated.
    `AliyunTypeface` | `getFontTypeface()` Set the font typeface style Added in v3.24.0
    `java.util.List<ActionBase>` | `getFrameAnimations()` Get Frame Animation List Added in v3.22.0
    `AliyunColor` | `getOutlineColor()` Get the text stroke color of caption Added in v3.22.0
    `float` | `getOutlineWidth()` Get the text stroke width, unit: pixel Added in v3.22.0
    `PointF` | `getPosition()` Get the center point position (x,y) of the Sticker, unit : pixel
    `float` | `getRotate()` Get the radian of rotation of the sticker
    `float` | `getScale()` Get the scale value of caption, the default is 1.0 Added in v3.22.0
    `AliyunColor` | `getShadowColor()` Get the shadow color of caption Added in v3.22.0
    `PointF` | `getShadowOffset()` Get the offset value of the shadow, including (x, y) two directions, unit: pixel，range: [0-32] Added in v3.22.0
    `RectF` | `getSize()` Get the size of the Sticker, get the width and height through `android.graphics.RectF#width()` and `android.graphics.RectF#height()`， unit : pixel
    `long` | `getStartTime()` Get Caption Render Start Time in microsecond
    `java.lang.String` | `getText()` Get Caption Text Added in v3.22.0
    `int` | `getTextAlignment()` Get alignment of text Added in v3.23.0
    `int` | `getType()` Gets the sticker type.
    `int` | `removeFrameAnimation(ActionBase action)` Removes an animation.
    `void` | `setBackgroundColor(AliyunColor aColor)` Set the background color of Caption Added in v3.23.0
    `void` | `setBackgroundCornerRadius(float radius)` Get the background radius of caption Added in v3.31.0
    `void` | `setBubbleEffectTemplate(Source aStyleTemplate)` Set the template for bubble text Added in v3.23.0
    `void` | `setBubbleEffectTemplate(java.lang.String aStyleTemplate)` Deprecated. Use `setBubbleEffectTemplate(Source)` instead.
    `void` | `setColor(AliyunColor aColor)` Set the text color of Caption Added in v3.22.0
    `void` | `setDuration(long aDuration, java.util.concurrent.TimeUnit timeUnit)` Set Caption Render Duration
    `void` | `setFontEffectTemplate(Source fontEffectSource)` Set the template for font effect Added in v3.23.0
    `void` | `setFontEffectTemplate(java.lang.String aStyleTemplate)` Deprecated. Use `setFontEffectTemplate(Source)` instead.
    `void` | `setFontPath(ISource aFontPath)` Set the font ttf of the caption Added in v3.24.0
    `void` | `setFontStyle(AliyunFontStyle aFontStyle)` Deprecated.
    `void` | `setFontTypeface(AliyunTypeface aFontTypeface)` Set the font typeface of the caption Added in v3.24.0
    `int` | `setFrameAnimation(ActionBase action)` Adds an animation to a stream or material.
    `void` | `setOutlineColor(AliyunColor aOutlineColor)` Set the text stroke color of caption Added in v3.22.0
    `void` | `setOutlineWidth(float aOutlineWidth)` Set the text stroke width, unit: pixel, range : [0-64] Added in v3.22.0
    `void` | `setPosition(PointF aPosition)` Set the center point position of the sticker (x,y), unit : pixel
    `void` | `setRotate(float degree)` Set the radian of rotation of the sticker
    `void` | `setScale(float aScale)` Set caption scale value Added in v3.22.0
    `void` | `setShadowColor(AliyunColor aShadowColor)` Set the shadow color of caption Added in v3.22.0
    `void` | `setShadowOffset(PointF aShadowOffset)` Set the offset value of the shadow, including (x, y) two directions, unit: pixel, range: [0-32] Added in v3.22.0
    `void` | `setStartTime(long aStartTime, java.util.concurrent.TimeUnit timeUnit)` Set Caption Render Start Time
    `void` | `setText(java.lang.String aText)` Set Caption Text Added in v3.22.0
    `void` | `setTextAlignment(int aTextAlignment)` Set the alignemnt of text Added in v3.23.0

    - ### Methods inherited from class com.aliyun.svideosdk.editor.impl.AliyunPasterAbstractController

      `getDuration, getStartTime, setDuration, setStartTime`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### AlignLeft

          public static final int AlignLeft

      See Also:
        Constant Field Values

    - #### AlignRight

          public static final int AlignRight

      See Also:
        Constant Field Values

    - #### AlignCenter

          public static final int AlignCenter

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getType

          public int getType()

      Description copied from interface: `AliyunIPasterController`
      Gets the sticker type.
      Returns:
        The sticker type.
      See Also:
        `EffectPaster.PASTER_TYPE_GIF`, `EffectPaster.PASTER_TYPE_CAPTION`, `EffectPaster.PASTER_TYPE_IMAGE`

    - #### getStartTime

          public long getStartTime()

      Description copied from interface: `AliyunIPasterController`
      Get Caption Render Start Time in microsecond
      Returns:
        Render Start Time in microsecond

    - #### setStartTime

          public void setStartTime(long aStartTime,
                                   java.util.concurrent.TimeUnit timeUnit)

      Description copied from interface: `AliyunIPasterController`
      Set Caption Render Start Time

      Added in v3.27.0

      Parameters:
        `aStartTime` - Start Time
        `timeUnit` - Time Unit

    - #### getDuration

          public long getDuration()

      Description copied from interface: `AliyunIPasterController`
      Get Caption Render Duration in microsecond
      Returns:
        Duration in microsecond

    - #### setDuration

          public void setDuration(long aDuration,
                                  java.util.concurrent.TimeUnit timeUnit)

      Description copied from interface: `AliyunIPasterController`
      Set Caption Render Duration

      Added in v3.27.0

      Parameters:
        `aDuration` - Duration
        `timeUnit` - Time Unit

    - #### getPosition

          public PointF getPosition()

      Description copied from interface: `AliyunIPasterController`
      Get the center point position (x,y) of the Sticker, unit : pixel
      Returns:
        center point position (x,y)

    - #### setPosition

          public void setPosition(PointF aPosition)

      Description copied from interface: `AliyunIPasterController`
      Set the center point position of the sticker (x,y), unit : pixel
      Parameters:
        `aPosition` - center point position (x,y)

    - #### getSize

          public RectF getSize()

      Description copied from interface: `AliyunIPasterController`
      Get the size of the Sticker, get the width and height through `android.graphics.RectF#width()` and `android.graphics.RectF#height()`， unit : pixel
      Returns:
        the size of the Sticker
      See Also:
        `android.graphics.RectF`

    - #### getRotate

          public float getRotate()

      Description copied from interface: `AliyunIPasterController`
      Get the radian of rotation of the sticker
      Returns:
        radian

    - #### setRotate

          public void setRotate(float degree)

      Description copied from interface: `AliyunIPasterController`
      Set the radian of rotation of the sticker
      Parameters:
        `degree` - radian

    - #### getText

          public java.lang.String getText()

      Get Caption Text Added in v3.22.0
      Returns:
        text

    - #### setText

          public void setText(java.lang.String aText)

      Set Caption Text Added in v3.22.0
      Parameters:
        `aText` - Text

    - #### getScale

          public float getScale()

      Get the scale value of caption, the default is 1.0 Added in v3.22.0
      Returns:
        the scale value of caption

    - #### setScale

          public void setScale(float aScale)

      Set caption scale value Added in v3.22.0
      Parameters:
        `aScale` - > 0

    - #### getFontStyle

          @Deprecated
          public AliyunFontStyle getFontStyle()

      Deprecated.
      Get the font style of the caption Added in v3.22.0
      Returns:
        the font style
      See Also:
        `AliyunFontStyle`

    - #### setFontStyle

          @Deprecated
          public void setFontStyle(AliyunFontStyle aFontStyle)

      Deprecated.
      Set the font style of the caption Added in v3.22.0
      Parameters:
        `aFontStyle` - the font style
      See Also:
        `AliyunFontStyle`

    - #### getFontPath

          public ISource getFontPath()

      Get Font Source Added in v3.24.0

    - #### setFontPath

          public void setFontPath(ISource aFontPath)

      Set the font ttf of the caption Added in v3.24.0
      Parameters:
        `aFontPath` - the font ttf path

    - #### getFontTypeface

          public AliyunTypeface getFontTypeface()

      Set the font typeface style Added in v3.24.0

    - #### setFontTypeface

          public void setFontTypeface(AliyunTypeface aFontTypeface)

      Set the font typeface of the caption Added in v3.24.0
      Parameters:
        `aFontTypeface` - the font typeface
      See Also:
        `AliyunTypeface`

    - #### getTextAlignment

          public int getTextAlignment()

      Get alignment of text Added in v3.23.0
      Returns:
        alignemnt

    - #### setTextAlignment

          public void setTextAlignment(int aTextAlignment)

      Set the alignemnt of text Added in v3.23.0
      Parameters:
        `aTextAlignment` - the alignment of text e.g. AlignLeft = 1; AlignRight = 2; AlignHCenter = 4;
      See Also:
        `AliyunFontStyle`

    - #### getColor

          public AliyunColor getColor()

      Get the text color of caption Added in v3.22.0
      Returns:
        color value
      See Also:
        `AliyunColor`

    - #### setColor

          public void setColor(AliyunColor aColor)

      Set the text color of Caption Added in v3.22.0
      Parameters:
        `aColor` - color value
      See Also:
        `AliyunColor`

    - #### getBackgroundColor

          public AliyunColor getBackgroundColor()

      Get the background color of caption Added in v3.23.0
      Returns:
        color value
      See Also:
        `AliyunColor`

    - #### setBackgroundColor

          public void setBackgroundColor(AliyunColor aColor)

      Set the background color of Caption Added in v3.23.0
      Parameters:
        `aColor` - color value
      See Also:
        `AliyunColor`

    - #### setBackgroundCornerRadius

          public void setBackgroundCornerRadius(float radius)

      Get the background radius of caption Added in v3.31.0

    - #### getBackgroundCornerRadius

          public float getBackgroundCornerRadius()

      Get the background radius of caption Added in v3.31.0
      Returns:
        value

    - #### getOutlineColor

          public AliyunColor getOutlineColor()

      Get the text stroke color of caption Added in v3.22.0
      Returns:
        color value
      See Also:
        `AliyunColor`

    - #### setOutlineColor

          public void setOutlineColor(AliyunColor aOutlineColor)

      Set the text stroke color of caption Added in v3.22.0
      Parameters:
        `aOutlineColor` - color value
      See Also:
        `AliyunColor`

    - #### getOutlineWidth

          public float getOutlineWidth()

      Get the text stroke width, unit: pixel Added in v3.22.0
      Returns:
        stroke width, unit: pixel

    - #### setOutlineWidth

          public void setOutlineWidth(float aOutlineWidth)

      Set the text stroke width, unit: pixel, range : [0-64] Added in v3.22.0
      Parameters:
        `aOutlineWidth` - stroke width, unit: pixel

    - #### getShadowColor

          public AliyunColor getShadowColor()

      Get the shadow color of caption Added in v3.22.0
      Returns:
        color value
      See Also:
        `AliyunColor`

    - #### setShadowColor

          public void setShadowColor(AliyunColor aShadowColor)

      Set the shadow color of caption Added in v3.22.0
      Parameters:
        `aShadowColor` - color value
      See Also:
        `AliyunColor`

    - #### getShadowOffset

          public PointF getShadowOffset()

      Get the offset value of the shadow, including (x, y) two directions, unit: pixel，range: [0-32] Added in v3.22.0
      Returns:
        The offset value of the shadow in (x,y)
      See Also:
        `android.graphics.PointF`

    - #### setShadowOffset

          public void setShadowOffset(PointF aShadowOffset)

      Set the offset value of the shadow, including (x, y) two directions, unit: pixel, range: [0-32] Added in v3.22.0
      Parameters:
        `aShadowOffset` - The offset value of the shadow in (x,y)
      See Also:
        `android.graphics.PointF`

    - #### setBubbleEffectTemplate

          public void setBubbleEffectTemplate(java.lang.String aStyleTemplate)

      Deprecated. Use `setBubbleEffectTemplate(Source)` instead.
      Set the template for bubble text Added in v3.22.0
      Parameters:
        `aStyleTemplate` - template path

    - #### getBubbleEffectTemplate

          public java.lang.String getBubbleEffectTemplate()

      Deprecated. Use `getBubbleEffectTemplateSource()` instead.
      Get the template path for bubble text Added in v3.22.0

    - #### setBubbleEffectTemplate

          public void setBubbleEffectTemplate(Source aStyleTemplate)

      Set the template for bubble text Added in v3.23.0
      Parameters:
        `aStyleTemplate` - template Source

    - #### getBubbleEffectTemplateSource

          public ISource getBubbleEffectTemplateSource()

      Get the template Source for bubble text Added in v3.23.0

    - #### setFontEffectTemplate

          public void setFontEffectTemplate(java.lang.String aStyleTemplate)

      Deprecated. Use `setFontEffectTemplate(Source)` instead.
      Set the template for font effect Added in v3.22.0
      Parameters:
        `aStyleTemplate` - template path

    - #### setFontEffectTemplate

          public void setFontEffectTemplate(Source fontEffectSource)

      Set the template for font effect Added in v3.23.0
      Parameters:
        `fontEffectSource` - template Source

    - #### getFontEffectTemplate

          public java.lang.String getFontEffectTemplate()

      Deprecated. Use `getFontEffectTemplateSource()` instead.
      Get the template path for font effect Added in v3.22.0

    - #### getFontEffectTemplateSource

          public ISource getFontEffectTemplateSource()

      Get the template Source for font effect Added in v3.23.0

    - #### apply

          public int apply()

    - #### addFrameAnimation

          public int addFrameAnimation(ActionBase action)

      Adds an animation to a stream or material. Added in v3.22.0
      Parameters:
        `action` -
      Returns:
        The effect id if the invocation is successful or an error code if the invocation fails.
      See Also:
        `ActionBase`

    - #### removeFrameAnimation

          public int removeFrameAnimation(ActionBase action)

      Removes an animation. Added in v3.22.0
      Parameters:
        `action` -
      Returns:
        0 if the invocation is successful or an error code if the invocation fails.

    - #### setFrameAnimation

          public int setFrameAnimation(ActionBase action)

      Adds an animation to a stream or material. It will clear last animations;
      Parameters:
        `action,` - if is null, will clean current animations
      Returns:
        The effect id if the invocation is successful or an error code if the invocation fails.
      See Also:
        `ActionBase`

    - #### clearFrameAnimation

          public int clearFrameAnimation()

      Clear Animation

    - #### getFrameAnimations

          public java.util.List<ActionBase> getFrameAnimations()

      Get Frame Animation List Added in v3.22.0
      Returns:
        Frame Animation List