java.lang.Object | |||
↳ | org.libpag.PAGLayer | ||
↳ | org.libpag.PAGComposition | ||
↳ | org.libpag.PAGFile |
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
|
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
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.
Asynchronously load a pag file from the specific path.
The maximum tag level current SDK supports.
Make a copy of the original file, any modification to current file has no effect on the result file.
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.
Return an array of layers by specified editable index and layer type.
Get a text data of the specified index. The index ranges from 0 to numTexts - 1. Note: It always returns the default text data.
The number of replaceable images.
The number of editable texts.
The number of video compositions.
The path string of this file, returns empty string if the file is loaded from byte stream.
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.
Replace the image data of the specified layer name. Passing in null for the image parameter will reset it to default image data.
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.
Set the duration of this PAGFile. Passing a value less than or equal to 0 resets the duration to its default value.
Set the timeStretchMode of this file.
The tag level this pag file requires.
Indicate how to stretch the original duration to fit target duration when file's duration is changed. The default value is PAGTimeStretchMode::Repeat.