diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGDecoder.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGDecoder.h index 4e8f7b1..87be997 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGDecoder.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGDecoder.h @@ -73,6 +73,13 @@ PAG_API @interface PAGDecoder : NSObject */ - (float)frameRate; +/** + * Returns true if the frame at the given index has changed since the last copyFrameTo(), + * readFrameTo(), or frameAtIndex() call. The caller should skip the corresponding call if + * the frame has not changed. + */ +- (BOOL)checkFrameChanged:(int)index; + /** * Copies pixels of the image frame at the given index to the specified memory address. The format * of the copied pixels is in the BGRA color type with the premultiplied alpha type. Returns false @@ -81,6 +88,13 @@ PAG_API @interface PAGDecoder : NSObject */ - (BOOL)copyFrameTo:(void*)pixels rowBytes:(size_t)rowBytes at:(NSInteger)index; +/** + * Reads pixels of the image frame at the given index into the specified CVPixelBuffer. Returns + * false if failed. Reading image frames into HardwareBuffer usually has better performance than + * reading into memory. + */ +- (BOOL)readFrame:(NSInteger)index to:(CVPixelBufferRef)pixelBuffer; + /** * Returns the image frame at the specified index. Note that this method must be called while the * app is not in the background. Otherwise, it may return nil because the GPU code may not be diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGFile.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGFile.h index e411cb3..87b075f 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGFile.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGFile.h @@ -37,6 +37,12 @@ PAG_API @interface PAGFile : PAGComposition */ + (PAGFile*)Load:(NSString*)path; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. + */ ++ (void)LoadAsync:(NSString*)path completionBlock:(void (^)(PAGFile*))callback; + /** * Load a pag file from byte data, return null if the bytes is empty or it's not a valid pag file. */ diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGImageView.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGImageView.h index ca4d2b4..6a265fb 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGImageView.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGImageView.h @@ -27,27 +27,30 @@ NS_ASSUME_NONNULL_BEGIN @optional /** - * Notifies the beginning of the animation. + * Notifies the beginning of the animation. It can be called from either the UI thread or the thread + * that calls the play method. */ - (void)onAnimationStart:(PAGImageView*)pagView; /** - * Notifies the end of the animation. + * Notifies the end of the animation. It can only be called from the UI thread. */ - (void)onAnimationEnd:(PAGImageView*)pagView; /** - * Notifies the cancellation of the animation. + * Notifies the cancellation of the animation. It can be called from either the UI thread or the + * thread that calls the stop method. */ - (void)onAnimationCancel:(PAGImageView*)pagView; /** - * Notifies the repetition of the animation. + * Notifies the repetition of the animation. It can only be called from the UI thread. */ - (void)onAnimationRepeat:(PAGImageView*)pagView; /** - * Notifies the frame updating of the animation. + * Notifies another frame of the animation has occurred. It may be called from an arbitrary + * thread if the animation is running asynchronously. */ - (void)onAnimationUpdate:(PAGImageView*)pagView; @@ -104,6 +107,21 @@ PAG_API @interface PAGImageView : UIImageView */ - (BOOL)setPath:(NSString*)filePath maxFrameRate:(float)maxFrameRate; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. If loading fails, PAGFile will be set to nil. + */ +- (void)setPathAsync:(NSString*)filePath completionBlock:(void (^)(PAGFile*))callback; + +/** + * Asynchronously load a PAG file from the specific path with the maxFrameRate limit, a block + * with PAGFile will be called when loading is complete. If loading fails, PAGFile will be set to + * nil. + */ +- (void)setPathAsync:(NSString*)filePath + maxFrameRate:(float)maxFrameRate + completionBlock:(void (^)(PAGFile*))callback; + /** * If set to true, the PAGImageView loads all image frames into the memory, which will significantly * increase the rendering performance but may cost lots of additional memory. Use it when you prefer @@ -130,14 +148,20 @@ PAG_API @interface PAGImageView : UIImageView - (void)setRenderScale:(float)scale; /** - * Set the number of times the animation will repeat. The default is 1, which means the animation - * will play only once. 0 means the animation will play infinity times. + * The total number of times the animation is set to play. The default is 1, which means the + * animation will play only once. If the repeat count is set to 0 or a negative value, the + * animation will play infinity times. + */ +- (int)repeatCount; + +/** + * Set the number of times the animation to play. */ - (void)setRepeatCount:(int)repeatCount; /** * Adds a listener to the set of listeners that are sent events through the life of an animation, - * such as start, repeat, and end. + * such as start, repeat, and end. PAGImageView only holds a weak reference to the listener. */ - (void)addListener:(id)listener; @@ -168,13 +192,16 @@ PAG_API @interface PAGImageView : UIImageView - (UIImage*)currentImage; /** - * Starts to play the animation. + * Starts to play the animation from the current position. Calling the play() method when the + * animation is already playing has no effect. The play() method does not alter the animation's + * current position. However, if the animation previously reached its end, it will restart from + * the beginning. */ - (void)play; /** - * Pauses the animation at the current playing position. Calling the play method can resume the - * animation from the last paused playing position. + * Cancels the animation at the current position. Calling the play() method can resume the animation + * from the last paused position. */ - (void)pause; @@ -184,10 +211,10 @@ PAG_API @interface PAGImageView : UIImageView - (BOOL)isPlaying; /** - * Renders the current image frame immediately. Note that all the changes previously made to the - * PAGImageView will only take effect after this method is called. If the play() method is already - * called, there is no need to call it manually since it will be automatically called every frame. - * Returns true if the content has changed. + * Call this method to render current position immediately. Note that all the changes previously + * made to the PAGImageView will only take effect after this method is called. If the play() method + * is already called, there is no need to call it manually since it will be automatically called + * every frame. Returns true if the content has changed. */ - (BOOL)flush; diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGLayer.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGLayer.h index 1eb9f26..3cd4b8d 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGLayer.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGLayer.h @@ -149,8 +149,8 @@ PAG_API @interface PAGLayer : NSObject - (PAGLayer*)trackMatteLayer; /** - * Returns a rectangle that defines the original area of the layer, which is not transformed by the - * matrix. + * Returns a rectangle int pixels that defines the original area of the layer, which is not + * transformed by the matrix. */ - (CGRect)getBounds; diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGPlayer.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGPlayer.h index 94ad87a..4226e46 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGPlayer.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGPlayer.h @@ -69,6 +69,18 @@ PAG_API @interface PAGPlayer : NSObject */ - (void)setCacheEnabled:(BOOL)value; +/** + * If set to true, PAG will cache the associated rendering data into a disk file, such as the + * decoded image frames of video compositions. This can help reduce memory usage and improve + * rendering performance. + */ +- (BOOL)useDiskCache; + +/** + * Set the value of useDiskCache property. + */ +- (void)setUseDiskCache:(BOOL)value; + /** * This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The * scale factors less than 1.0 may result in blurred output, but it can reduce the usage of graphics @@ -149,8 +161,8 @@ PAG_API @interface PAGPlayer : NSObject - (BOOL)flush; /** - * Returns a rectangle that defines the displaying area of the specified layer, which is in the - * coordinate of the PAGSurface. + * Returns a rectangle in pixels that defines the displaying area of the specified layer, which is + * in the coordinate of the PAGSurface. */ - (CGRect)getBounds:(PAGLayer*)pagLayer; diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGSurface.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGSurface.h index 10f0340..58c9f19 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGSurface.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGSurface.h @@ -44,13 +44,14 @@ PAG_API @interface PAGSurface : NSObject + (PAGSurface*)FromCVPixelBuffer:(CVPixelBufferRef)pixelBuffer context:(EAGLContext*)eaglContext; /** - * [Deprecated] Please use MakeOffscreen:size instead. + * [Deprecated](Please use [PAGSurface MakeOffscreen] instead) + * Creates an offscreen PAGSurface of the specified size for pixel reading. */ -+ (PAGSurface*)MakeFromGPU:(CGSize)size; ++ (PAGSurface*)MakeFromGPU:(CGSize)size + DEPRECATED_MSG_ATTRIBUTE("Please use [PAGSurface MakeOffscreen] instead."); /** - * Creates a offscreen PAGSurface of specified size. PAGSurface internally creates a CVPixelBuffer - * which can be accessed by [PAGSurface getCVPixelBuffer] after the first [PAGPLayer flush]. + * Creates an offscreen PAGSurface of the specified size for pixel reading. */ + (PAGSurface*)MakeOffscreen:(CGSize)size; @@ -60,12 +61,12 @@ PAG_API @interface PAGSurface : NSObject - (int)width; /** - * The height of surface in pixels. + * The height of the surface in pixels. */ - (int)height; /** - * Update the size of surface, and reset the internal surface. + * Update the size of the surface, and reset the internal surface. */ - (void)updateSize; @@ -81,8 +82,8 @@ PAG_API @interface PAGSurface : NSObject - (void)freeCache; /** - * Returns the internal CVPixelBuffer object associated with this PAGSurface, returns nil if this - * PAGSurface is created by [PAGSurface FromLayer]. + * Returns the internal CVPixelBuffer object associated with this PAGSurface, returns nil if the + * PAGSurface is created by [PAGSurface FromLayer], or the app is running in the simulator. */ - (CVPixelBufferRef)getCVPixelBuffer; diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGView.h b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGView.h index 32aab79..3c64a3d 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGView.h +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/Headers/PAGView.h @@ -21,31 +21,35 @@ #import "PAGLayer.h" @class PAGView; + @protocol PAGViewListener @optional /** - * Notifies the start of the animation. + * Notifies the beginning of the animation. It can be called from either the UI thread or the thread + * that calls the play method. */ - (void)onAnimationStart:(PAGView*)pagView; /** - * Notifies the end of the animation. + * Notifies the end of the animation. It can only be called from the UI thread. */ - (void)onAnimationEnd:(PAGView*)pagView; /** - * Notifies the cancellation of the animation. + * Notifies the cancellation of the animation. It can be called from either the UI thread or the + * thread that calls the stop method. */ - (void)onAnimationCancel:(PAGView*)pagView; /** - * Notifies the repetition of the animation. + * Notifies the repetition of the animation. It can only be called from the UI thread. */ - (void)onAnimationRepeat:(PAGView*)pagView; /** - * Notifies the occurrence of another frame of the animation. + * Notifies another frame of the animation has occurred. It may be called from an arbitrary + * thread if the animation is running asynchronously. */ - (void)onAnimationUpdate:(PAGView*)pagView; @@ -53,14 +57,9 @@ PAG_API @interface PAGView : UIView -/** - * Default is NO. - */ -@property(nonatomic) BOOL sync; - /** * Adds a listener to the set of listeners that are sent events through the life of an animation, - * such as start, repeat, and end. + * such as start, repeat, and end. PAGView only holds a weak reference to the listener. */ - (void)addListener:(id)listener; @@ -70,25 +69,52 @@ PAG_API @interface PAGView : UIView - (void)removeListener:(id)listener; /** - * Indicates whether or not this pag view is playing. + * Indicates whether the animation is allowed to run in the UI thread. The default value is NO. + * Regardless of whether the animation runs asynchronously, all listener callbacks will be called + * on the UI thread. + */ +- (BOOL)sync; + +/** + * Set whether the animation is allowed to run in the UI thread. + */ +- (void)setSync:(BOOL)value; + +/** + * The total number of times the animation is set to play. The default is 1, which means the + * animation will play only once. If the repeat count is set to 0 or a negative value, the + * animation will play infinity times. + */ +- (int)repeatCount; + +/** + * Set the number of times the animation to play. + */ +- (void)setRepeatCount:(int)repeatCount; + +/** + * Indicates whether this pag view is playing. */ - (BOOL)isPlaying; /** - * Start the animation. + * Starts to play the animation from the current position. Calling the play() method when the + * animation is already playing has no effect. The play() method does not alter the animation's + * current position. However, if the animation previously reached its end, it will restart from + * the beginning. */ - (void)play; /** - * Stop the animation. + * Cancels the animation at the current position. Calling the play() method can resume the animation + * from the last paused position. */ -- (void)stop; +- (void)pause; /** - * Set the number of times the animation will repeat. The default is 1, which means the animation - * will play only once. 0 means the animation will play infinity times. + * Cancels the animation at the current position. Currently, it has the same effect as pause(). */ -- (void)setRepeatCount:(int)repeatCount; +- (void)stop; /** * The path string of a pag file set by setPath. @@ -103,6 +129,12 @@ PAG_API @interface PAGView : UIView */ - (BOOL)setPath:(NSString*)filePath; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. If loading fails, PAGFile will be set to nil. + */ +- (void)setPathAsync:(NSString*)filePath completionBlock:(void (^)(PAGFile*))callback; + /** * Returns the current PAGComposition for PAGView to render as content. */ @@ -138,6 +170,18 @@ PAG_API @interface PAGView : UIView */ - (void)setCacheEnabled:(BOOL)value; +/** + * If set to true, PAG will cache the associated rendering data into a disk file, such as the + * decoded image frames of video compositions. This can help reduce memory usage and improve + * rendering performance. + */ +- (BOOL)useDiskCache; + +/** + * Set the value of useDiskCache property. + */ +- (void)setUseDiskCache:(BOOL)value; + /** * This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The * scale factors less than 1.0 may result in blurred output, but it can reduce the usage of graphics @@ -174,7 +218,7 @@ PAG_API @interface PAGView : UIView - (void)setScaleMode:(PAGScaleMode)value; /** - * Returns a copy of current matrix. + * Returns a copy of the current matrix. */ - (CGAffineTransform)matrix; @@ -230,4 +274,10 @@ PAG_API @interface PAGView : UIView * the PAGView will not be captured. Returns nil if the PAGView hasn't been presented yet. */ - (CVPixelBufferRef)makeSnapshot; + +/** + * Returns a rectangle in pixels that defines the displaying area of the specified layer, which is + * in the coordinate of the PAGView. + */ +- (CGRect)getBounds:(PAGLayer*)pagLayer; @end diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/_CodeSignature/CodeResources b/framework/libpag.xcframework/ios-arm64/libpag.framework/_CodeSignature/CodeResources index 213b133..db8d607 100644 --- a/framework/libpag.xcframework/ios-arm64/libpag.framework/_CodeSignature/CodeResources +++ b/framework/libpag.xcframework/ios-arm64/libpag.framework/_CodeSignature/CodeResources @@ -18,7 +18,7 @@ Headers/PAGDecoder.h - KY+MxK6kjlNrcSStzoFCW/0lcWE= + iycvUyfyMq4r9NcDe4E5rqOmpWo= Headers/PAGDiskCache.h @@ -26,7 +26,7 @@ Headers/PAGFile.h - 6qxEt4ehM8CDxbqhmFgkZ0A2ciw= + 1//WwprIj+NvZ1irXsZul4T6FNk= Headers/PAGFont.h @@ -42,11 +42,11 @@ Headers/PAGImageView.h - c67dBULhTqMVi5EnqmChpNj5v2U= + drNqDXrTEQFAE1zuEBaV54Ufnyo= Headers/PAGLayer.h - BOvNmOkNXVxLWcCzuB9u8rmqS20= + RilkCEV8YdEoX0VAksGAlFI28ks= Headers/PAGMarker.h @@ -54,7 +54,7 @@ Headers/PAGPlayer.h - jOmQawB7hTESO/3qnaGNGoM9Wlk= + Rc1b+rMBd/4udtxllCD3gQYYd2g= Headers/PAGScaleMode.h @@ -70,7 +70,7 @@ Headers/PAGSurface.h - 5VJjX2KmyaIykcvCb/V8qa/LcRM= + UTyx1JDKgjRQN5cndLoQl7Cm85g= Headers/PAGText.h @@ -94,7 +94,7 @@ Headers/PAGView.h - 9/3CYF8thDzg4qS6fXQAfljkMmY= + Ksrfzx3H5C/ig8s78hSqXeoMTlc= Headers/libpag-umbrella.h @@ -148,11 +148,11 @@ hash - KY+MxK6kjlNrcSStzoFCW/0lcWE= + iycvUyfyMq4r9NcDe4E5rqOmpWo= hash2 - mFg3IJO2nWsJ0Egnb/LVNlC0mv1RDFjsV6nsF1UjAI4= + uoP36uOJreBqU7Wzdfvl7iuGt8aqqIbt7MUKsRSfPKE= Headers/PAGDiskCache.h @@ -170,11 +170,11 @@ hash - 6qxEt4ehM8CDxbqhmFgkZ0A2ciw= + 1//WwprIj+NvZ1irXsZul4T6FNk= hash2 - K9oOhODokXqQ/Oo8KwEW//ix2ptr9uj8pFIDq2HM24k= + aKrLvqsBgdYtcgTkNgyKupBmWVtja0CLyEICXK/M61k= Headers/PAGFont.h @@ -214,22 +214,22 @@ hash - c67dBULhTqMVi5EnqmChpNj5v2U= + drNqDXrTEQFAE1zuEBaV54Ufnyo= hash2 - 8GxBJgakL5xUpvJ9X2BK9ibR7kf+5TTWntByKDEdaUs= + NaHHlhE565SOmyTIPWeOJ11OWAMs3TjF5Mfy7G4kOlU= Headers/PAGLayer.h hash - BOvNmOkNXVxLWcCzuB9u8rmqS20= + RilkCEV8YdEoX0VAksGAlFI28ks= hash2 - sSBwxwkGqBoGNRrYwCo2aarGQvR9WbX7IuI4kAQ/fSs= + NGc2n6KnA9FE8W+TmOhcT4aQdLoh3fDuKZNMo1XdkQg= Headers/PAGMarker.h @@ -247,11 +247,11 @@ hash - jOmQawB7hTESO/3qnaGNGoM9Wlk= + Rc1b+rMBd/4udtxllCD3gQYYd2g= hash2 - CFEyVVSy7rLYZIjwyvB9tNoCbcK4hhxfA42wEr5naoo= + 3EkPGqcI2yQqJRc0B6HwqIK349dfLA2xrMMrqIE8eZ8= Headers/PAGScaleMode.h @@ -291,11 +291,11 @@ hash - 5VJjX2KmyaIykcvCb/V8qa/LcRM= + UTyx1JDKgjRQN5cndLoQl7Cm85g= hash2 - O/lzOHRsnxKe8UZEUSNTI9SlIg2AHyfMTBstYmgzPoU= + Dwv0tbtxQ0kxcvgvm7U51Soix+Zr99wfNAWyOu7nyT8= Headers/PAGText.h @@ -357,11 +357,11 @@ hash - 9/3CYF8thDzg4qS6fXQAfljkMmY= + Ksrfzx3H5C/ig8s78hSqXeoMTlc= hash2 - /MT4JbQMUKRF5zuWdza4q+w8tUSCiweed2w66QusAuQ= + g52/dIlpAgTskPYaVIRJuhdgLMzFI3P7yIBdHlWv/fE= Headers/libpag-umbrella.h diff --git a/framework/libpag.xcframework/ios-arm64/libpag.framework/libpag b/framework/libpag.xcframework/ios-arm64/libpag.framework/libpag index f3ac822..829a687 100755 Binary files a/framework/libpag.xcframework/ios-arm64/libpag.framework/libpag and b/framework/libpag.xcframework/ios-arm64/libpag.framework/libpag differ diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGDecoder.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGDecoder.h index 4e8f7b1..87be997 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGDecoder.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGDecoder.h @@ -73,6 +73,13 @@ PAG_API @interface PAGDecoder : NSObject */ - (float)frameRate; +/** + * Returns true if the frame at the given index has changed since the last copyFrameTo(), + * readFrameTo(), or frameAtIndex() call. The caller should skip the corresponding call if + * the frame has not changed. + */ +- (BOOL)checkFrameChanged:(int)index; + /** * Copies pixels of the image frame at the given index to the specified memory address. The format * of the copied pixels is in the BGRA color type with the premultiplied alpha type. Returns false @@ -81,6 +88,13 @@ PAG_API @interface PAGDecoder : NSObject */ - (BOOL)copyFrameTo:(void*)pixels rowBytes:(size_t)rowBytes at:(NSInteger)index; +/** + * Reads pixels of the image frame at the given index into the specified CVPixelBuffer. Returns + * false if failed. Reading image frames into HardwareBuffer usually has better performance than + * reading into memory. + */ +- (BOOL)readFrame:(NSInteger)index to:(CVPixelBufferRef)pixelBuffer; + /** * Returns the image frame at the specified index. Note that this method must be called while the * app is not in the background. Otherwise, it may return nil because the GPU code may not be diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGFile.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGFile.h index e411cb3..87b075f 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGFile.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGFile.h @@ -37,6 +37,12 @@ PAG_API @interface PAGFile : PAGComposition */ + (PAGFile*)Load:(NSString*)path; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. + */ ++ (void)LoadAsync:(NSString*)path completionBlock:(void (^)(PAGFile*))callback; + /** * Load a pag file from byte data, return null if the bytes is empty or it's not a valid pag file. */ diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGImageView.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGImageView.h index ca4d2b4..6a265fb 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGImageView.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGImageView.h @@ -27,27 +27,30 @@ NS_ASSUME_NONNULL_BEGIN @optional /** - * Notifies the beginning of the animation. + * Notifies the beginning of the animation. It can be called from either the UI thread or the thread + * that calls the play method. */ - (void)onAnimationStart:(PAGImageView*)pagView; /** - * Notifies the end of the animation. + * Notifies the end of the animation. It can only be called from the UI thread. */ - (void)onAnimationEnd:(PAGImageView*)pagView; /** - * Notifies the cancellation of the animation. + * Notifies the cancellation of the animation. It can be called from either the UI thread or the + * thread that calls the stop method. */ - (void)onAnimationCancel:(PAGImageView*)pagView; /** - * Notifies the repetition of the animation. + * Notifies the repetition of the animation. It can only be called from the UI thread. */ - (void)onAnimationRepeat:(PAGImageView*)pagView; /** - * Notifies the frame updating of the animation. + * Notifies another frame of the animation has occurred. It may be called from an arbitrary + * thread if the animation is running asynchronously. */ - (void)onAnimationUpdate:(PAGImageView*)pagView; @@ -104,6 +107,21 @@ PAG_API @interface PAGImageView : UIImageView */ - (BOOL)setPath:(NSString*)filePath maxFrameRate:(float)maxFrameRate; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. If loading fails, PAGFile will be set to nil. + */ +- (void)setPathAsync:(NSString*)filePath completionBlock:(void (^)(PAGFile*))callback; + +/** + * Asynchronously load a PAG file from the specific path with the maxFrameRate limit, a block + * with PAGFile will be called when loading is complete. If loading fails, PAGFile will be set to + * nil. + */ +- (void)setPathAsync:(NSString*)filePath + maxFrameRate:(float)maxFrameRate + completionBlock:(void (^)(PAGFile*))callback; + /** * If set to true, the PAGImageView loads all image frames into the memory, which will significantly * increase the rendering performance but may cost lots of additional memory. Use it when you prefer @@ -130,14 +148,20 @@ PAG_API @interface PAGImageView : UIImageView - (void)setRenderScale:(float)scale; /** - * Set the number of times the animation will repeat. The default is 1, which means the animation - * will play only once. 0 means the animation will play infinity times. + * The total number of times the animation is set to play. The default is 1, which means the + * animation will play only once. If the repeat count is set to 0 or a negative value, the + * animation will play infinity times. + */ +- (int)repeatCount; + +/** + * Set the number of times the animation to play. */ - (void)setRepeatCount:(int)repeatCount; /** * Adds a listener to the set of listeners that are sent events through the life of an animation, - * such as start, repeat, and end. + * such as start, repeat, and end. PAGImageView only holds a weak reference to the listener. */ - (void)addListener:(id)listener; @@ -168,13 +192,16 @@ PAG_API @interface PAGImageView : UIImageView - (UIImage*)currentImage; /** - * Starts to play the animation. + * Starts to play the animation from the current position. Calling the play() method when the + * animation is already playing has no effect. The play() method does not alter the animation's + * current position. However, if the animation previously reached its end, it will restart from + * the beginning. */ - (void)play; /** - * Pauses the animation at the current playing position. Calling the play method can resume the - * animation from the last paused playing position. + * Cancels the animation at the current position. Calling the play() method can resume the animation + * from the last paused position. */ - (void)pause; @@ -184,10 +211,10 @@ PAG_API @interface PAGImageView : UIImageView - (BOOL)isPlaying; /** - * Renders the current image frame immediately. Note that all the changes previously made to the - * PAGImageView will only take effect after this method is called. If the play() method is already - * called, there is no need to call it manually since it will be automatically called every frame. - * Returns true if the content has changed. + * Call this method to render current position immediately. Note that all the changes previously + * made to the PAGImageView will only take effect after this method is called. If the play() method + * is already called, there is no need to call it manually since it will be automatically called + * every frame. Returns true if the content has changed. */ - (BOOL)flush; diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGLayer.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGLayer.h index 1eb9f26..3cd4b8d 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGLayer.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGLayer.h @@ -149,8 +149,8 @@ PAG_API @interface PAGLayer : NSObject - (PAGLayer*)trackMatteLayer; /** - * Returns a rectangle that defines the original area of the layer, which is not transformed by the - * matrix. + * Returns a rectangle int pixels that defines the original area of the layer, which is not + * transformed by the matrix. */ - (CGRect)getBounds; diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGPlayer.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGPlayer.h index 94ad87a..4226e46 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGPlayer.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGPlayer.h @@ -69,6 +69,18 @@ PAG_API @interface PAGPlayer : NSObject */ - (void)setCacheEnabled:(BOOL)value; +/** + * If set to true, PAG will cache the associated rendering data into a disk file, such as the + * decoded image frames of video compositions. This can help reduce memory usage and improve + * rendering performance. + */ +- (BOOL)useDiskCache; + +/** + * Set the value of useDiskCache property. + */ +- (void)setUseDiskCache:(BOOL)value; + /** * This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The * scale factors less than 1.0 may result in blurred output, but it can reduce the usage of graphics @@ -149,8 +161,8 @@ PAG_API @interface PAGPlayer : NSObject - (BOOL)flush; /** - * Returns a rectangle that defines the displaying area of the specified layer, which is in the - * coordinate of the PAGSurface. + * Returns a rectangle in pixels that defines the displaying area of the specified layer, which is + * in the coordinate of the PAGSurface. */ - (CGRect)getBounds:(PAGLayer*)pagLayer; diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGSurface.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGSurface.h index 10f0340..58c9f19 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGSurface.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGSurface.h @@ -44,13 +44,14 @@ PAG_API @interface PAGSurface : NSObject + (PAGSurface*)FromCVPixelBuffer:(CVPixelBufferRef)pixelBuffer context:(EAGLContext*)eaglContext; /** - * [Deprecated] Please use MakeOffscreen:size instead. + * [Deprecated](Please use [PAGSurface MakeOffscreen] instead) + * Creates an offscreen PAGSurface of the specified size for pixel reading. */ -+ (PAGSurface*)MakeFromGPU:(CGSize)size; ++ (PAGSurface*)MakeFromGPU:(CGSize)size + DEPRECATED_MSG_ATTRIBUTE("Please use [PAGSurface MakeOffscreen] instead."); /** - * Creates a offscreen PAGSurface of specified size. PAGSurface internally creates a CVPixelBuffer - * which can be accessed by [PAGSurface getCVPixelBuffer] after the first [PAGPLayer flush]. + * Creates an offscreen PAGSurface of the specified size for pixel reading. */ + (PAGSurface*)MakeOffscreen:(CGSize)size; @@ -60,12 +61,12 @@ PAG_API @interface PAGSurface : NSObject - (int)width; /** - * The height of surface in pixels. + * The height of the surface in pixels. */ - (int)height; /** - * Update the size of surface, and reset the internal surface. + * Update the size of the surface, and reset the internal surface. */ - (void)updateSize; @@ -81,8 +82,8 @@ PAG_API @interface PAGSurface : NSObject - (void)freeCache; /** - * Returns the internal CVPixelBuffer object associated with this PAGSurface, returns nil if this - * PAGSurface is created by [PAGSurface FromLayer]. + * Returns the internal CVPixelBuffer object associated with this PAGSurface, returns nil if the + * PAGSurface is created by [PAGSurface FromLayer], or the app is running in the simulator. */ - (CVPixelBufferRef)getCVPixelBuffer; diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGView.h b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGView.h index 32aab79..3c64a3d 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGView.h +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/Headers/PAGView.h @@ -21,31 +21,35 @@ #import "PAGLayer.h" @class PAGView; + @protocol PAGViewListener @optional /** - * Notifies the start of the animation. + * Notifies the beginning of the animation. It can be called from either the UI thread or the thread + * that calls the play method. */ - (void)onAnimationStart:(PAGView*)pagView; /** - * Notifies the end of the animation. + * Notifies the end of the animation. It can only be called from the UI thread. */ - (void)onAnimationEnd:(PAGView*)pagView; /** - * Notifies the cancellation of the animation. + * Notifies the cancellation of the animation. It can be called from either the UI thread or the + * thread that calls the stop method. */ - (void)onAnimationCancel:(PAGView*)pagView; /** - * Notifies the repetition of the animation. + * Notifies the repetition of the animation. It can only be called from the UI thread. */ - (void)onAnimationRepeat:(PAGView*)pagView; /** - * Notifies the occurrence of another frame of the animation. + * Notifies another frame of the animation has occurred. It may be called from an arbitrary + * thread if the animation is running asynchronously. */ - (void)onAnimationUpdate:(PAGView*)pagView; @@ -53,14 +57,9 @@ PAG_API @interface PAGView : UIView -/** - * Default is NO. - */ -@property(nonatomic) BOOL sync; - /** * Adds a listener to the set of listeners that are sent events through the life of an animation, - * such as start, repeat, and end. + * such as start, repeat, and end. PAGView only holds a weak reference to the listener. */ - (void)addListener:(id)listener; @@ -70,25 +69,52 @@ PAG_API @interface PAGView : UIView - (void)removeListener:(id)listener; /** - * Indicates whether or not this pag view is playing. + * Indicates whether the animation is allowed to run in the UI thread. The default value is NO. + * Regardless of whether the animation runs asynchronously, all listener callbacks will be called + * on the UI thread. + */ +- (BOOL)sync; + +/** + * Set whether the animation is allowed to run in the UI thread. + */ +- (void)setSync:(BOOL)value; + +/** + * The total number of times the animation is set to play. The default is 1, which means the + * animation will play only once. If the repeat count is set to 0 or a negative value, the + * animation will play infinity times. + */ +- (int)repeatCount; + +/** + * Set the number of times the animation to play. + */ +- (void)setRepeatCount:(int)repeatCount; + +/** + * Indicates whether this pag view is playing. */ - (BOOL)isPlaying; /** - * Start the animation. + * Starts to play the animation from the current position. Calling the play() method when the + * animation is already playing has no effect. The play() method does not alter the animation's + * current position. However, if the animation previously reached its end, it will restart from + * the beginning. */ - (void)play; /** - * Stop the animation. + * Cancels the animation at the current position. Calling the play() method can resume the animation + * from the last paused position. */ -- (void)stop; +- (void)pause; /** - * Set the number of times the animation will repeat. The default is 1, which means the animation - * will play only once. 0 means the animation will play infinity times. + * Cancels the animation at the current position. Currently, it has the same effect as pause(). */ -- (void)setRepeatCount:(int)repeatCount; +- (void)stop; /** * The path string of a pag file set by setPath. @@ -103,6 +129,12 @@ PAG_API @interface PAGView : UIView */ - (BOOL)setPath:(NSString*)filePath; +/** + * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called + * when loading is complete. If loading fails, PAGFile will be set to nil. + */ +- (void)setPathAsync:(NSString*)filePath completionBlock:(void (^)(PAGFile*))callback; + /** * Returns the current PAGComposition for PAGView to render as content. */ @@ -138,6 +170,18 @@ PAG_API @interface PAGView : UIView */ - (void)setCacheEnabled:(BOOL)value; +/** + * If set to true, PAG will cache the associated rendering data into a disk file, such as the + * decoded image frames of video compositions. This can help reduce memory usage and improve + * rendering performance. + */ +- (BOOL)useDiskCache; + +/** + * Set the value of useDiskCache property. + */ +- (void)setUseDiskCache:(BOOL)value; + /** * This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The * scale factors less than 1.0 may result in blurred output, but it can reduce the usage of graphics @@ -174,7 +218,7 @@ PAG_API @interface PAGView : UIView - (void)setScaleMode:(PAGScaleMode)value; /** - * Returns a copy of current matrix. + * Returns a copy of the current matrix. */ - (CGAffineTransform)matrix; @@ -230,4 +274,10 @@ PAG_API @interface PAGView : UIView * the PAGView will not be captured. Returns nil if the PAGView hasn't been presented yet. */ - (CVPixelBufferRef)makeSnapshot; + +/** + * Returns a rectangle in pixels that defines the displaying area of the specified layer, which is + * in the coordinate of the PAGView. + */ +- (CGRect)getBounds:(PAGLayer*)pagLayer; @end diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/_CodeSignature/CodeResources b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/_CodeSignature/CodeResources index ca7e8c3..69de9d9 100644 --- a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/_CodeSignature/CodeResources +++ b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/_CodeSignature/CodeResources @@ -18,7 +18,7 @@ Headers/PAGDecoder.h - KY+MxK6kjlNrcSStzoFCW/0lcWE= + iycvUyfyMq4r9NcDe4E5rqOmpWo= Headers/PAGDiskCache.h @@ -26,7 +26,7 @@ Headers/PAGFile.h - 6qxEt4ehM8CDxbqhmFgkZ0A2ciw= + 1//WwprIj+NvZ1irXsZul4T6FNk= Headers/PAGFont.h @@ -42,11 +42,11 @@ Headers/PAGImageView.h - c67dBULhTqMVi5EnqmChpNj5v2U= + drNqDXrTEQFAE1zuEBaV54Ufnyo= Headers/PAGLayer.h - BOvNmOkNXVxLWcCzuB9u8rmqS20= + RilkCEV8YdEoX0VAksGAlFI28ks= Headers/PAGMarker.h @@ -54,7 +54,7 @@ Headers/PAGPlayer.h - jOmQawB7hTESO/3qnaGNGoM9Wlk= + Rc1b+rMBd/4udtxllCD3gQYYd2g= Headers/PAGScaleMode.h @@ -70,7 +70,7 @@ Headers/PAGSurface.h - 5VJjX2KmyaIykcvCb/V8qa/LcRM= + UTyx1JDKgjRQN5cndLoQl7Cm85g= Headers/PAGText.h @@ -94,7 +94,7 @@ Headers/PAGView.h - 9/3CYF8thDzg4qS6fXQAfljkMmY= + Ksrfzx3H5C/ig8s78hSqXeoMTlc= Headers/libpag-umbrella.h @@ -148,11 +148,11 @@ hash - KY+MxK6kjlNrcSStzoFCW/0lcWE= + iycvUyfyMq4r9NcDe4E5rqOmpWo= hash2 - mFg3IJO2nWsJ0Egnb/LVNlC0mv1RDFjsV6nsF1UjAI4= + uoP36uOJreBqU7Wzdfvl7iuGt8aqqIbt7MUKsRSfPKE= Headers/PAGDiskCache.h @@ -170,11 +170,11 @@ hash - 6qxEt4ehM8CDxbqhmFgkZ0A2ciw= + 1//WwprIj+NvZ1irXsZul4T6FNk= hash2 - K9oOhODokXqQ/Oo8KwEW//ix2ptr9uj8pFIDq2HM24k= + aKrLvqsBgdYtcgTkNgyKupBmWVtja0CLyEICXK/M61k= Headers/PAGFont.h @@ -214,22 +214,22 @@ hash - c67dBULhTqMVi5EnqmChpNj5v2U= + drNqDXrTEQFAE1zuEBaV54Ufnyo= hash2 - 8GxBJgakL5xUpvJ9X2BK9ibR7kf+5TTWntByKDEdaUs= + NaHHlhE565SOmyTIPWeOJ11OWAMs3TjF5Mfy7G4kOlU= Headers/PAGLayer.h hash - BOvNmOkNXVxLWcCzuB9u8rmqS20= + RilkCEV8YdEoX0VAksGAlFI28ks= hash2 - sSBwxwkGqBoGNRrYwCo2aarGQvR9WbX7IuI4kAQ/fSs= + NGc2n6KnA9FE8W+TmOhcT4aQdLoh3fDuKZNMo1XdkQg= Headers/PAGMarker.h @@ -247,11 +247,11 @@ hash - jOmQawB7hTESO/3qnaGNGoM9Wlk= + Rc1b+rMBd/4udtxllCD3gQYYd2g= hash2 - CFEyVVSy7rLYZIjwyvB9tNoCbcK4hhxfA42wEr5naoo= + 3EkPGqcI2yQqJRc0B6HwqIK349dfLA2xrMMrqIE8eZ8= Headers/PAGScaleMode.h @@ -291,11 +291,11 @@ hash - 5VJjX2KmyaIykcvCb/V8qa/LcRM= + UTyx1JDKgjRQN5cndLoQl7Cm85g= hash2 - O/lzOHRsnxKe8UZEUSNTI9SlIg2AHyfMTBstYmgzPoU= + Dwv0tbtxQ0kxcvgvm7U51Soix+Zr99wfNAWyOu7nyT8= Headers/PAGText.h @@ -357,11 +357,11 @@ hash - 9/3CYF8thDzg4qS6fXQAfljkMmY= + Ksrfzx3H5C/ig8s78hSqXeoMTlc= hash2 - /MT4JbQMUKRF5zuWdza4q+w8tUSCiweed2w66QusAuQ= + g52/dIlpAgTskPYaVIRJuhdgLMzFI3P7yIBdHlWv/fE= Headers/libpag-umbrella.h diff --git a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/libpag b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/libpag index 07ebd3b..5723eba 100755 Binary files a/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/libpag and b/framework/libpag.xcframework/ios-arm64_x86_64-simulator/libpag.framework/libpag differ diff --git a/libpag.podspec b/libpag.podspec index 0359e41..5e3d570 100644 --- a/libpag.podspec +++ b/libpag.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'libpag' - s.version = '0.16.101' + s.version = '4.3.30' s.ios.deployment_target = '9.0' s.summary = 'libpag SDK' s.homepage = 'https://github.com/libpag/libpag-ios'