Swiftgram/AsyncDisplayKit/ASImageNode+AnimatedImage.h
Garrett Moon 3bcbfb149d Add support for animated GIFs
Summary:
Use NSData as key

Add chunking of files

Add support for Animated Images

This adds support for GIF playback in ASDK. It's not currently ready
for merging to public ASDK – for one the GIF decompression may make
more sense in PINRemoteImage.

Removed duration as it wasn't used

Make cover image lazily loaded

Differential Revision: https://phabricator.pinadmin.com/D82033
2016-04-13 14:23:02 -07:00

37 lines
694 B
Objective-C

//
// ASImageNode+AnimatedImage.h
// Pods
//
// Created by Garrett Moon on 3/22/16.
//
//
#import "ASImageNode.h"
#import "ASThread.h"
@interface ASImageNode ()
{
ASDN::RecursiveMutex _animatedImageLock;
ASDN::Mutex _displayLinkLock;
ASAnimatedImage *_animatedImage;
CADisplayLink *_displayLink;
//accessed on main thread only
CFTimeInterval _playHead;
NSUInteger _playedLoops;
}
@property (atomic, assign) BOOL animatedImagePaused;
@property (atomic, assign) CFTimeInterval lastDisplayLinkFire;
@end
@interface ASImageNode (AnimatedImage)
@property (nullable, atomic, strong) ASAnimatedImage *animatedImage;
- (void)coverImageCompleted:(UIImage *)coverImage;
@end