com.aliyun.svideosdk.editor

## Interface AliyunPasterRender

-     public interface AliyunPasterRender

  An interface for rendering stickers in the underlying layer.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addCaption(AliyunCaption aCaption)`
    `int` | `addCaptionPaster(Bitmap bmp, EffectCaption caption)` Deprecated.
    `int` | `addCaptionPaster(BitmapGenerator generator, EffectCaption caption)` Deprecated.
    `int` | `addEffectPaster(EffectPaster paster)` Adds a sticker.
    `int` | `addSubtitle(Bitmap bmp, EffectText subtitle)` Deprecated.
    `int` | `addSubtitle(BitmapGenerator generator, EffectText subtitle)` Deprecated.
    `int` | `applyPaintCanvas(EffectPaint effectPaint)` Adds a doodle.
    `java.util.List<AliyunCaption>` | `findCaptions(long timeInUs)`
    `Size` | `getDisplaySize()` Sets the rect of the display area where the sticker is rendered.
    `int` | `hidePaster(EffectPaster paster)` Hides a sticker.
    `void` | `removeCanvas()` Removes a doodle.
    `int` | `removeCaption(AliyunCaption caption)`
    `int` | `removePaster(EffectPaster paster)` Removes a sticker.
    `void` | `setDisplaySize(int width, int height)` Sets the size of the display area where the sticker is rendered.
    `int` | `setEffectWaterMark(EffectImage image)` Adds a watermark.
    `void` | `setOnPasterResumeAndSave(OnPasterResumeAndSave listener)` Sets the callback that is invoked when a sticker is restored or saved.
    `int` | `showCaptionPaster(Bitmap bmp, EffectCaption caption)` Deprecated. Replaced by `showCaptionPaster(Bitmap, EffectCaption)`
    `int` | `showCaptionPaster(BitmapGenerator bitmapGenerator, EffectCaption caption)` Shows an animated caption.
    `int` | `showPaster(EffectPaster paster)` Shows a sticker.
    `int` | `showTextPaster(Bitmap bmp, EffectText text)` Shows a standard caption.
    `int` | `showTextPaster(BitmapGenerator generator, EffectText text)` Shows a standard caption.
    `int` | `updateCaption(AliyunCaption caption)`

- - ### Method Detail

    - #### 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.
      Parameters:
        `width` -
        `height` -

    - #### getDisplaySize

          Size getDisplaySize()

      Sets the rect 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.
      Returns:

    - #### setOnPasterResumeAndSave

          void setOnPasterResumeAndSave(OnPasterResumeAndSave listener)

      Sets the callback that is invoked when a sticker is restored or saved. After a view is recycled in the UI layer, resources such as stickers will be released in the rendering layer. It is therefore recommended to save stickers at the right time. When a sticker is saved, the onPasterSave method defined in `OnPasterResumeAndSave` is invoked. This method requires a list of stickers as the input parameter. The `PasterTrack` class is used to save stickers.
      Parameters:
        `listener` -

    - #### addSubtitle

          @Deprecated
          int addSubtitle(Bitmap bmp,
                                      EffectText subtitle)

      Deprecated.
      Adds a standard caption.
      Parameters:
        `bmp` - The bitmap image that represents the standard caption.
        `subtitle` - The caption object.
      Returns:
        `AliyunErrorCode.ERROR_DUPLICATE_ADD_EFFECT` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID`

    - #### addSubtitle

          @Deprecated
          int addSubtitle(BitmapGenerator generator,
                                      EffectText subtitle)

      Deprecated.
      Adds a standard caption.
      Parameters:
        `generator` - The generator that generates the bitmap image representing the standard caption.
        `subtitle` - The caption object.
      Returns:
        `AliyunErrorCode.ERROR_DUPLICATE_ADD_EFFECT` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID`

    - #### addEffectPaster

          int addEffectPaster(EffectPaster paster)

      Adds a sticker.
      Parameters:
        `paster` - The sticker object.
      Returns:
        `AliyunErrorCode.ERROR_DUPLICATE_ADD_EFFECT` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST` `AliyunEditorErrorCode.SVIDEO_EDITOR_PARSE_RESOURCE_FAILED` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID`

    - #### setEffectWaterMark

          int setEffectWaterMark(EffectImage image)

      Adds a watermark.
      Parameters:
        `image` - The watermark object.
      Returns:
        `AliyunErrorCode.ERROR_EFFECT_USE_FAILED` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST` `AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED`

    - #### addCaptionPaster

          @Deprecated
          int addCaptionPaster(Bitmap bmp,
                                           EffectCaption caption)

      Deprecated.
      Adds an animated caption.
      Parameters:
        `bmp` - The bitmap image that represents the animated caption.
        `caption` - The caption object.
      Returns:
        `AliyunErrorCode.ERROR_DUPLICATE_ADD_EFFECT` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST` `AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED` `AliyunEditorErrorCode.SVIDEO_EDITOR_PARSE_RESOURCE_FAILED` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID`

    - #### addCaptionPaster

          @Deprecated
          int addCaptionPaster(BitmapGenerator generator,
                                           EffectCaption caption)

      Deprecated.
      Adds an animated caption.
      Parameters:
        `generator` - The generator that generates the bitmap image representing the animated caption.
        `caption` - The caption object.
      Returns:
        `AliyunErrorCode.ERROR_DUPLICATE_ADD_EFFECT` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST` `AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED` `AliyunEditorErrorCode.SVIDEO_EDITOR_PARSE_RESOURCE_FAILED` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID`

    - #### removePaster

          int removePaster(EffectPaster paster)

      Removes a sticker. Once removed, the sticker is not rendered in the underlying layer.
      Parameters:
        `paster` - The sticker object.

    - #### hidePaster

          int hidePaster(EffectPaster paster)

      Hides a sticker.
      Parameters:
        `paster` - The sticker object.

    - #### showPaster

          int showPaster(EffectPaster paster)

      Shows a sticker. The effect of this method is the same as when addEffectPaster() is invoked following the execution of removePaster().
      Parameters:
        `paster` - The sticker object.

    - #### showTextPaster

          int showTextPaster(Bitmap bmp,
                             EffectText text)

      Shows a standard caption.
      Parameters:
        `bmp` - The bitmap image that represents the standard caption.
        `text` - The caption object.

    - #### showTextPaster

          int showTextPaster(BitmapGenerator generator,
                             EffectText text)

      Shows a standard caption.
      Parameters:
        `generator` -
        `text` -

    - #### showCaptionPaster

          int showCaptionPaster(Bitmap bmp,
                                EffectCaption caption)

      Deprecated. Replaced by `showCaptionPaster(Bitmap, EffectCaption)`
      Shows an animated caption.
      Parameters:
        `bmp` - The bitmap image that represents the animated caption.
        `caption` - The caption object.

    - #### showCaptionPaster

          int showCaptionPaster(BitmapGenerator bitmapGenerator,
                                EffectCaption caption)

      Shows an animated caption.
      Parameters:
        `bitmapGenerator` - The generator that generates the bitmap image representing the animated caption.
        `caption` - The caption object.

    - #### removeCanvas

          void removeCanvas()

      Removes a doodle.

    - #### applyPaintCanvas

          int applyPaintCanvas(EffectPaint effectPaint)

      Adds a doodle.
      Parameters:
        `effectPaint` -
      Returns:
        `AliyunErrorCode.ERROR_EFFECT_USE_FAILED` `AliyunErrorCode.ERROR_PARAM_IMAGE_FILE_PATH_INVALID` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST` `AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED`

    - #### addCaption

          int addCaption(AliyunCaption aCaption)

    - #### removeCaption

          int removeCaption(AliyunCaption caption)

    - #### updateCaption

          int updateCaption(AliyunCaption caption)

    - #### findCaptions

          java.util.List<AliyunCaption> findCaptions(long timeInUs)