SCGIFImageView.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // SCGIFImageView.h
  3. // TestGIF
  4. //
  5. // Created by shichangone on 11-7-12.
  6. // Copyright 2011 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface AnimatedGifFrame : NSObject
  10. {
  11. NSData *data;
  12. NSData *header;
  13. double delay;
  14. int disposalMethod;
  15. CGRect area;
  16. }
  17. @property (nonatomic, copy) NSData *header;
  18. @property (nonatomic, copy) NSData *data;
  19. @property (nonatomic) double delay;
  20. @property (nonatomic) int disposalMethod;
  21. @property (nonatomic) CGRect area;
  22. @end
  23. @interface SCGIFImageView : UIImageView {
  24. NSData *GIF_pointer;
  25. NSMutableData *GIF_buffer;
  26. NSMutableData *GIF_screen;
  27. NSMutableData *GIF_global;
  28. NSMutableArray *GIF_frames;
  29. int GIF_sorted;
  30. int GIF_colorS;
  31. int GIF_colorC;
  32. int GIF_colorF;
  33. int animatedGifDelay;
  34. int dataPointer;
  35. }
  36. @property (nonatomic, retain) NSMutableArray *GIF_frames;
  37. - (id)initWithGIFFile:(NSString*)gifFilePath;
  38. - (id)initWithGIFData:(NSData*)gifImageData;
  39. - (void)loadImageData;
  40. + (NSMutableArray*)getGifFrames:(NSData*)gifImageData;
  41. + (BOOL)isGifImage:(NSData*)imageData;
  42. - (void) decodeGIF:(NSData *)GIFData;
  43. - (void) GIFReadExtensions;
  44. - (void) GIFReadDescriptor;
  45. - (bool) GIFGetBytes:(int)length;
  46. - (bool) GIFSkipBytes: (int) length;
  47. - (NSData*) getFrameAsDataAtIndex:(int)index;
  48. - (UIImage*) getFrameAsImageAtIndex:(int)index;
  49. @end