com.aliyun.svideosdk.editor

## Interface AliyunPasterManager

-     public interface AliyunPasterManager

  An interface that is used to create sticker managers, which use rendering methods to display stickers correctly in the UI. To add stickers in the UI, `setDisplaySize(int, int)` must be invoked to specify the size of the display area where the stickers are rendered.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `AliyunPasterControllerCompoundCaption` | `addCaptionWithStartTime(java.lang.String text, Source bubbleEffectSource, Source fontSource, long startTimeInUs, long durationInUs)` Adds a standard caption and sets the display duration of the caption.
    `AliyunPasterControllerCompoundCaption` | `addCaptionWithStartTime(java.lang.String text, Source bubbleEffectSource, Source fontSource, long startTime, long duration, java.util.concurrent.TimeUnit timeUnit)` Adds a standard caption and sets the display duration of the caption.
    `AliyunPasterControllerCompoundCaption` | `addCaptionWithStartTime(java.lang.String text, java.lang.String bubbleEffectPath, java.lang.String font, long startTimeInUs, long durationInUs)` Deprecated. Use `addCaptionWithStartTime(String,Source,Source,long,long)` instead.
    `AliyunPasterControllerImage` | `addImage(Source source)` Adds a image.
    `AliyunPasterController` | `addPaster(Source source)` Adds a sticker.
    `AliyunPasterController` | `addPaster(java.lang.String path)` Deprecated. Replaced by `addPaster(Source)`.
    `AliyunPasterController` | `addPasterWithStartTime(Source source, long startTimeInUs, long durationInUs)` Adds a sticker and sets the display duration of the sticker.
    `AliyunPasterController` | `addPasterWithStartTime(Source source, long startTime, long duration, java.util.concurrent.TimeUnit timeUnit)` Adds a sticker and sets the display duration of the sticker.
    `AliyunPasterController` | `addPasterWithStartTime(java.lang.String path, long startTimeInUs, long durationInUs)` Deprecated. Replaced by `addPasterWithStartTime(Source,long,long)`.
    `AliyunPasterController` | `addSubtitle(java.lang.String text, Source font)` Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption. Added in v3.23.0
    `AliyunPasterController` | `addSubtitle(java.lang.String text, java.lang.String font)` Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption.
    `AliyunPasterController` | `addSubtitleWithStartTime(java.lang.String text, Source font, long startTimeInUs, long durationInUs)` Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption and sets the display duration of the caption. Added in v3.23.0
    `AliyunPasterController` | `addSubtitleWithStartTime(java.lang.String text, java.lang.String font, long startTimeInUs, long durationInUs)` Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption and sets the display duration of the caption.
    `AliyunIPasterController` | `findControllerAtPoint(PointF point, long timeInUs)` Find paster controller at startTime in microseconds Added in v3.22.0
    `AliyunIPasterController` | `findControllerAtPoint(PointF point, long time, java.util.concurrent.TimeUnit timeUnit)` Find paster controller at startTime
    `java.util.List<AliyunIPasterController>` | `findControllersByType(int type)` Find paster controller for selected type
    `void` | `remove(AliyunIPasterController aController)` delete aController 贴图控制器
    `void` | `setDisplaySize(int width, int height)` Sets the size of the display area where the sticker is rendered.
    `void` | `setOnPasterRestoreListener(OnPasterRestored listener)` Sets the callback that is used to restore UI settings when a sticker is restored.

- - ### Method Detail

    - #### addPaster

          @Deprecated
          AliyunPasterController addPaster(java.lang.String path)

      Deprecated. Replaced by `addPaster(Source)`.
      Adds a sticker.
      Parameters:
        `path` - The path of the sticker.
      Returns:
        The sticker manager.

    - #### addPaster

          AliyunPasterController addPaster(Source source)

      Adds a sticker.
      Parameters:
        `source` - The path of the sticker.
      Returns:
        The sticker manager.

    - #### addPasterWithStartTime

          @Deprecated
          AliyunPasterController addPasterWithStartTime(java.lang.String path,
                                                                    long startTimeInUs,
                                                                    long durationInUs)

      Deprecated. Replaced by `addPasterWithStartTime(Source,long,long)`.
      Adds a sticker and sets the display duration of the sticker.
      Parameters:
        `path` - The path of the sticker.Unit : Microseconds
        `startTimeInUs` - The time when the sticker is set to visible.Unit : Microseconds
        `durationInUs` - The display duration of the sticker.
      Returns:
        The sticker manager.

    - #### addPasterWithStartTime

          AliyunPasterController addPasterWithStartTime(Source source,
                                                        long startTimeInUs,
                                                        long durationInUs)

      Adds a sticker and sets the display duration of the sticker.
      Parameters:
        `source` - The path of the sticker.
        `startTimeInUs` - The time when the sticker is set to visible.Unit : Microseconds
        `durationInUs` - The display duration of the sticker.Unit : Microseconds
      Returns:
        The sticker manager.

    - #### addPasterWithStartTime

          AliyunPasterController addPasterWithStartTime(Source source,
                                                        long startTime,
                                                        long duration,
                                                        java.util.concurrent.TimeUnit timeUnit)

      Adds a sticker and sets the display duration of the sticker.
      Parameters:
        `source` - The path of the sticker.
        `startTime` - The time when the sticker is set to visible.
        `duration` - The display duration of the sticker.
        `timeUnit` - The time unit
      Returns:
        The sticker manager.

    - #### addSubtitle

          @Deprecated
          AliyunPasterController addSubtitle(java.lang.String text,
                                                         java.lang.String font)

      Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption.
      Parameters:
        `text` - The text contents.
        `font` - The text font.
      Returns:
        The sticker manager.

    - #### addSubtitle

          @Deprecated
          AliyunPasterController addSubtitle(java.lang.String text,
                                                         Source font)

      Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption. Added in v3.23.0
      Parameters:
        `text` - The text contents.
        `font` - The text font resource.
      Returns:
        The sticker manager.

    - #### addSubtitleWithStartTime

          @Deprecated
          AliyunPasterController addSubtitleWithStartTime(java.lang.String text,
                                                                      java.lang.String font,
                                                                      long startTimeInUs,
                                                                      long durationInUs)

      Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption and sets the display duration of the caption.
      Parameters:
        `text` - The text contents.
        `font` - The text font.
        `startTimeInUs` - The time when the caption is set to visible.Unit : Microseconds
        `durationInUs` - The display duration of the caption.Unit : Microseconds
      Returns:
        The sticker manager.

    - #### addSubtitleWithStartTime

          @Deprecated
          AliyunPasterController addSubtitleWithStartTime(java.lang.String text,
                                                                      Source font,
                                                                      long startTimeInUs,
                                                                      long durationInUs)

      Deprecated. use `addCaptionWithStartTime(java.lang.String, java.lang.String, java.lang.String, long, long)` instead Adds a standard caption and sets the display duration of the caption. Added in v3.23.0
      Parameters:
        `text` - The text contents.
        `font` - The text font.
        `startTimeInUs` - The time when the caption is set to visible. .Unit : Microseconds
        `durationInUs` - The display duration of the caption..Unit : Microseconds
      Returns:
        The sticker manager.

    - #### addCaptionWithStartTime

          @Deprecated
          AliyunPasterControllerCompoundCaption addCaptionWithStartTime(java.lang.String text,
                                                                                    java.lang.String bubbleEffectPath,
                                                                                    java.lang.String font,
                                                                                    long startTimeInUs,
                                                                                    long durationInUs)

      Deprecated. Use `addCaptionWithStartTime(String,Source,Source,long,long)` instead.
      Adds a standard caption and sets the display duration of the caption. Added in v3.22.0
      Parameters:
        `text` - The text contents.
        `bubbleEffectPath` - the bubble effect path
        `font` - The text font.
        `startTimeInUs` - The time when the caption is set to visible..Unit : Microseconds
        `durationInUs` - The display duration of the caption..Unit : Microseconds
      Returns:
        The sticker manager.

    - #### addCaptionWithStartTime

          AliyunPasterControllerCompoundCaption addCaptionWithStartTime(java.lang.String text,
                                                                        Source bubbleEffectSource,
                                                                        Source fontSource,
                                                                        long startTimeInUs,
                                                                        long durationInUs)

      Adds a standard caption and sets the display duration of the caption. Added in v3.23.0
      Parameters:
        `text` - The text contents.
        `bubbleEffectSource` - the bubble effect source
        `fontSource` - The text font source.
        `startTimeInUs` - The time when the caption is set to visible..Unit : Microseconds
        `durationInUs` - The display duration of the caption..Unit : Microseconds
      Returns:
        The sticker controller.

    - #### addCaptionWithStartTime

          AliyunPasterControllerCompoundCaption addCaptionWithStartTime(java.lang.String text,
                                                                        Source bubbleEffectSource,
                                                                        Source fontSource,
                                                                        long startTime,
                                                                        long duration,
                                                                        java.util.concurrent.TimeUnit timeUnit)

      Adds a standard caption and sets the display duration of the caption. Added in v3.23.0
      Parameters:
        `text` - The text contents.
        `bubbleEffectSource` - the bubble effect source
        `fontSource` - The text font source.
        `startTime` - The time when the caption is set to visible.
        `duration` - The display duration of the caption.
        `timeUnit` - The time unit
      Returns:
        The sticker controller.

    - #### addImage

          AliyunPasterControllerImage addImage(Source source)

      Adds a image.

      Added in v3.27.0

      Parameters:
        `source` - The path of the sticker.
      Returns:
        The sticker controller.

    - #### findControllerAtPoint

          AliyunIPasterController findControllerAtPoint(PointF point,
                                                        long timeInUs)

      Find paster controller at startTime in microseconds Added in v3.22.0
      Parameters:
        `point` - click point between 0 and 1 in pixels
        `timeInUs` - the caption show time in microseconds
      Returns:
        PasterController

    - #### findControllerAtPoint

          AliyunIPasterController findControllerAtPoint(PointF point,
                                                        long time,
                                                        java.util.concurrent.TimeUnit timeUnit)

      Find paster controller at startTime

      Added in v3.27.0

      Parameters:
        `point` - click point between 0 and 1 in pixels
        `time` - the paster show time
        `timeUnit` - the time unit
      Returns:
        PasterController

    - #### findControllersByType

          java.util.List<AliyunIPasterController> findControllersByType(int type)

      Find paster controller for selected type
      Parameters:
        `type` - the paster controller type
      Returns:
        PasterController

    - #### remove

          void remove(AliyunIPasterController aController)

      delete aController 贴图控制器

    - #### setDisplaySize

          void setDisplaySize(int width,
                              int height)

      Sets the size of the display area where the sticker is rendered. The size and position of the sticker in the video are determined by the size and position of the display area. This method must be invoked before `AliyunIEditor.init(SurfaceView, Context)`.
      Parameters:
        `width` -
        `height` -
      Throws:
        `java.lang.IllegalStateException` - if the width or height is set to 0.

    - #### setOnPasterRestoreListener

          void setOnPasterRestoreListener(OnPasterRestored listener)

      Sets the callback that is used to restore UI settings when a sticker is restored. This method must be invoked before `AliyunIEditor.init(SurfaceView, Context)`. Otherwise, effects such as stickers, captions, and doodles cannot be restored.
      Parameters:
        `listener` -