public class

PAGFile

extends PAGComposition
java.lang.Object
   ↳ org.libpag.PAGLayer
     ↳ org.libpag.PAGComposition
       ↳ org.libpag.PAGFile

Summary

Nested Classes
interface PAGFile.LoadListener  
[Expand]
Inherited Constants
From class org.libpag.PAGLayer
[Expand]
Inherited Fields
From class org.libpag.PAGLayer
Public Methods
static PAGFile Load(AssetManager manager, String fileName)
Load a pag file from assets, returns null if the file does not exist or the data is not a pag file.
static PAGFile Load(byte[] bytes)
static PAGFile Load(String path)
Load a pag file from the specified path, returns null if the file does not exist or the data is not a pag file.
static void LoadAsync(String path, PAGFile.LoadListener listener)
Asynchronously load a pag file from the specific path.
static int MaxSupportedTagLevel()
The maximum tag level current SDK supports.
PAGFile copyOriginal()
Make a copy of the original file, any modification to current file has no effect on the result file.
int[] getEditableIndices(int layerType)
Returns the indices of the editable layers in this PAGFile.
PAGLayer[] getLayersByEditableIndex(int editableIndex, int layerType)
Return an array of layers by specified editable index and layer type.
PAGText getTextData(int index)
Get a text data of the specified index.
void nativeReplaceImage(int editableImageIndex, long image)
void nativeReplaceImageByName(String layerName, long image)
int numImages()
The number of replaceable images.
int numTexts()
The number of editable texts.
int numVideos()
The number of video compositions.
String path()
The path string of this file, returns empty string if the file is loaded from byte stream.
void replaceImage(int editableImageIndex, PAGImage image)
Replace the image data of the specified index.
void replaceImageByName(String layerName, PAGImage image)
Replace the image data of the specified layer name.
void replaceText(int editableTextIndex, PAGText textData)
Replace the text data of the specified index.
void setDuration(long duration)
Set the duration of this PAGFile.
void setTimeStretchMode(int value)
Set the timeStretchMode of this file.
int tagLevel()
The tag level this pag file requires.
int timeStretchMode()
Indicate how to stretch the original duration to fit target duration when file's duration is changed.
[Expand]
Inherited Methods
From class org.libpag.PAGComposition
From class org.libpag.PAGLayer
From class java.lang.Object

Public Methods

public static PAGFile Load (AssetManager manager, String fileName)

Load a pag file from assets, returns null if the file does not exist or the data is not a pag file. Note: The same path shares resource in memory untill the file is released. If the file may be changed, please use 'Load(byte[])' instead

public static PAGFile Load (byte[] bytes)

public static PAGFile Load (String path)

Load a pag file from the specified path, returns null if the file does not exist or the data is not a pag file. Note: All PAGFiles loaded by the same path share the same internal cache. The internal cache is alive until all PAGFiles are released. Use 'PAGFile.Load(byte[])' instead if you don't want to load a PAGFile from the intenal caches.

public static void LoadAsync (String path, PAGFile.LoadListener listener)

Asynchronously load a pag file from the specific path.

public static int MaxSupportedTagLevel ()

The maximum tag level current SDK supports.

public PAGFile copyOriginal ()

Make a copy of the original file, any modification to current file has no effect on the result file.

public int[] getEditableIndices (int layerType)

Returns the indices of the editable layers in this PAGFile. If the editableIndex of a PAGLayer is not present in the returned indices, the PAGLayer should not be treated as editable.

public PAGLayer[] getLayersByEditableIndex (int editableIndex, int layerType)

Return an array of layers by specified editable index and layer type.

public PAGText getTextData (int index)

Get a text data of the specified index. The index ranges from 0 to numTexts - 1. Note: It always returns the default text data.

public void nativeReplaceImage (int editableImageIndex, long image)

public void nativeReplaceImageByName (String layerName, long image)

public int numImages ()

The number of replaceable images.

public int numTexts ()

The number of editable texts.

public int numVideos ()

The number of video compositions.

public String path ()

The path string of this file, returns empty string if the file is loaded from byte stream.

public void replaceImage (int editableImageIndex, PAGImage image)

Replace the image data of the specified index. The index ranges from 0 to PAGFile.numImages - 1. Passing in null for the image parameter will reset it to default image data.

public void replaceImageByName (String layerName, PAGImage image)

Replace the image data of the specified layer name. Passing in null for the image parameter will reset it to default image data.

public void replaceText (int editableTextIndex, PAGText textData)

Replace the text data of the specified index. The index ranges from 0 to PAGFile.numTexts - 1. Passing in null for the textData parameter will reset it to default text data.

public void setDuration (long duration)

Set the duration of this PAGFile. Passing a value less than or equal to 0 resets the duration to its default value.

public void setTimeStretchMode (int value)

Set the timeStretchMode of this file.

public int tagLevel ()

The tag level this pag file requires.

public int timeStretchMode ()

Indicate how to stretch the original duration to fit target duration when file's duration is changed. The default value is PAGTimeStretchMode::Repeat.